LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA config problem.

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

0 Kudos
Message 1 of 7
(2,983 Views)

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.

0 Kudos
Message 2 of 7
(2,977 Views)

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

0 Kudos
Message 3 of 7
(2,971 Views)

And what do you get at the output of the VISA Read vi?

 

Ben64

0 Kudos
Message 4 of 7
(2,960 Views)

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

 

 

0 Kudos
Message 5 of 7
(2,957 Views)

If the data is truncated, you need to read more bytes. In the pictures you showed VISA Read is set to read 256 bytes, increase this number. The VISA Read function will "stop" after receiving the termination character or after reading the requested amount of bytes, whatever comes first.

Ben64

0 Kudos
Message 6 of 7
(2,954 Views)

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

0 Kudos
Message 7 of 7
(2,936 Views)