LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I can read and write to my device in MAX, but serial read and write VI's don't work

I am trying to communicate to a Stanford Research Systems SR 245 digital analog convertor via LabVIEW.  In MAX I can write commands to the device and read from the device, and everything is working fine.  In LabVIEW the device is never written to; the "bytes at port" is always zero. 

 

I am connecting to the device via a DB9 to DB25 cable.  I don't fully understand how this works; is there any way this could be causing the problem or does the fact that the commands work in MAX imply that it is simply a problem with my VI?

 

I have an indicator on the "return count" terminal of the "serial write" VI which says that there have been 2 bytes transferred (or other value), but as I said, immediately following this in the data flow, the port contains zero bytes.  If I exit the program and open MAX, the instrument does not exhibit the state I would expect had the write-command actually registered (although I'm not positive that I can conclude anything from that).

 

Thanks very much for any suggestions.

0 Kudos
Message 1 of 4
(2,128 Views)

Something is wrong with your VI. Perhaps you are not sending a termination character. Do you have '\' Code Display turned on?

0 Kudos
Message 2 of 4
(2,109 Views)

Also, unless I'm mistaken, "bytes at port" refers to incoming data

 

 

0 Kudos
Message 3 of 4
(2,105 Views)

n00b mistake.  Thank you!  And yeah I was wrong about bytes at port as well.

0 Kudos
Message 4 of 4
(2,088 Views)