Page 1 of 1

filewrite(pncFile

Posted: November 7th, 2016, 5:36 am
by jkajiba
Dear All

I am trying to see if it is possible to pass values of DeviceId and UID to a filewrite function.

eg: filewrite(pncFile,"ServerPath=/mccdata/'%DeviceID%'/'%UID%'");

John

Re: filewrite(pncFile

Posted: November 7th, 2016, 10:25 am
by josh
Try removing the ' around them:

filewrite(pncFile,"ServerPath=/mccdata/%DeviceID%/%UID%");

Re: filewrite(pncFile

Posted: November 8th, 2016, 7:05 am
by jkajiba
Dear Josh

After removing ' . I am getting below warnings

WARNING: Number of '%' arguments passed (0) does not match the number expected in the message text (1).
WARNING: Number of '%' arguments passed (0) does not match the number expected in the message text (1).

Re: filewrite(pncFile

Posted: November 8th, 2016, 5:27 pm
by josh
Sorry. I forgot that it would try to interpret the '%D' in '%DeviceId' as if it was %d and it is looking for a replacement. Try the following instead:

filewrite(pncFile, "ServerPath=/mccdata/%s/%UID%", "%DeviceID%");

or

filewrite(pncFile, "ServerPath=/mccdata/%s/%UID%", getdeviceid());