LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with VISA...trying to write/read simple command from serial

Hardware handshaking (which I have rarely seen actually used) could be causing it.

Be sure to set the flow control enum that goes into your serial config function to rts/cts or dts/dsr.  Actually check all of those settings.  I see coercion dots where they go into the serial config VI.  The controls look like U16 text rings.  If I delete the wires and create constants from the config VI, they show up as U16 enums.  The enum for the flow control input actually has many more settings than your text ring control.

You can programmatically set and read the state of the flow control lines through a property node of the VISA control.  They are under serial settings then Modem line settings in the VISA property node functions.  I don't know whether that would be necessary or not in your program.  Maybe just setting the flow control state at the beginning of the program will work.

0 Kudos
Message 21 of 24
(1,007 Views)
And please, just because you see some signals with the scope, do not assume that the transmission is correct. All that you have done is verify that the cable does not have an open. You still might be using an incorrect cable. If you are using a null-modem cable, try switching to a straight through and vice versa. Nor does seeing a signal with the scope say that the data sent is correct or you have the correct serial settings. Ask the vendor if there is a simple test program available that you can run.
0 Kudos
Message 22 of 24
(993 Views)
Hello!
thank you for your help!

So what I could see in the oscilopscope was the following: I had a demo program of the vendor and I had my labview model. The demo software is working properly. What you can see is that the these two programs send with a differnt baudrate. The manual says 9600, I put 9600 in my Labview model. But the Bit length is different to the Bit length of the demoprogram. I measured the first bit (start bit). Demo Program is 9 mircoseconds, Labview is 100 micro seconds. I cannot understand that, because according to the manual 9600 is the right one. If a put 115.200 in labview, the lengh of one bit is the same as the one iof the demo program. But still I don¨t get an answer. Could it be that I put something wrong in my labview model, or where is the mistake? How can I change the baudrate besides the VISA configure serial port?

What as well the vendor told me is that I should flush the buffer before writing things to the equipment. How can I do that and is it useful in your opinion?

Furthermore they told me to use hardware handshake CTS/RTS, but if I put this in labview, there is nothing send to the equipment according to the osciloscope! If I but no flowcontrol or something else, labview send bytes to the equipment. That is strange and I cannot understand that.

All in all I think the different baudrate is the main problem. Would be very helpful if you could give me an useful advise.


Thank you very much in advance!!



0 Kudos
Message 23 of 24
(969 Views)

Hi Lorenzo,

The following KnowledgeBase document may help you set the baud rate:

How Do I Set the Baud Rate in LabVIEW to Match the Baud Rate in Measurement & Automation Explorer?

I hope this helps!

Regards,

Rima

Rima H.
Web Product Manager
0 Kudos
Message 24 of 24
(945 Views)