03-14-2012 10:21 AM
Hi,
So an existing device I am working on requires double end charactors for the serial communications. I tried the following found at the bottom of this page, but I have some issues on the string it specifys after the VISA read "scan from string" block
http://zone.ni.com/devzone/cda/tut/p/id/4256
The end charactors are 0A0D as stated in the example (As with my code). But what does "%[^,], TDS %d"mean, as it flags an error!!
Any help is much appriciated.
Thanks ;D
03-14-2012 10:29 AM
Obviously that format string is unique to the instrument that the original code was written for. Are you using the same instrument? If not, then there is no point in using that scan from string.
03-14-2012 10:38 AM
But my point is "%[^,], TDS %d" does not work. It generates an error. "Too many format specifiers". This has nothing to do with the device.
I needed exactly what it specified in the example. But the example does not work.
Thanks
03-14-2012 11:04 AM
03-14-2012 11:29 AM
It truncates the data.
For example....
3A4C 0707 0D07 4717 0749 9105 3602 0455 FB07 45BD 0748 A007 45E1 0D0A This is ok but....
But,
3A4C 0707 2107 4736 0749 7405 35F3 0456 0907 45ED 0748 D207 460A
0D0A
Truncates. I want to be able to ensure that the whole messages is processed based on 3A4C "data" 0A0D
03-14-2012 11:34 AM
03-15-2012 03:18 AM
Problem is. My data includes 0A and 0D. So it truncates because of this. Does any one know how to fix this problem?! Surely others have run into the same issue.
I know the protocol is partly to blame. For example.
It should not have 2 end termination charactors
It should perhaps not transmit 0D or OA in the data.
However I find it hard to believe that the termination of the VISA cannot be extended to 2 terminations "0D0A"
Thanks