The legal use of cannabis by terminally ill adults in NSW is about to come a step closer with a clinical trial being established by the government.

The trial will be devised by a working party that will report back to the government by the end of the year, Premier Mike Baird announced on Tuesday.

First step towards new laws: Dan Haslam with his parents, Lou and Lucy, and wife Alyce (right). Credit:Geoff O'Neill

Unveiling the government's much-anticipated response to the issue during question time, Mr Baird also said the existing NSW police discretion to not charge terminally ill adults if they are caught using cannabis for pain relief would be formalised through new guidelines.

It is understood that as part of the change a register of terminally ill patients and their carers will be established.