Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Bytes at serial port not read!

Hi,
 
I have an instrument which I'm trying to communicate with through a serial port.  With the use of Labview 8.0 example 'Basic Serial Write and Read.vi', I was able to send a command and read back the response from the instrument with no problems.  But when I started using my own program (which is almost like a 'copy' of the example vi) I got a timeout error and didn't get any reading.   The problem is at the 'bytes at serial port' property node which somehow keeps returning 0 byte.  Can anyone help me find where in my program did I make a mistake in copying? 😛
 
Thank you.
0 Kudos
Message 1 of 8
(3,904 Views)
You made a very common mistake. The example VI has a string control with '\' Codes Display turned on. Your string constant on the diagram is set for normal display so you are not send the CR and LF control characters. You are sending the text '\', 'r','\', and 'n'. Right click on the constant, change the display type, and redo the control characters.
Message 2 of 8
(3,897 Views)
Oops... I'm quite new to Labview so didn't know that bit.  Now everything works fine. Thanks a lot Dennis Smiley Happy
0 Kudos
Message 3 of 8
(3,886 Views)

Hi,

 

I have a problem with the property node. I'm doing the serial communication with labview and ZigBee Xbee API. I send a data frame API to identify the routers on the network and send me Xbee several data frames depending on the amount of Xbee there, when I use the instruction bytes at port is sometimes sends me the amount of a one Xbee, sometimes 0 bytes and never fullamount of the frames. I can do to solve this problem?

 

Thanks

0 Kudos
Message 4 of 8
(3,349 Views)

The problem could be something as simple as not waiting long enough before checking the property.

0 Kudos
Message 5 of 8
(3,345 Views)

Thanks, that was the problem. But if I have too many devices on the network would have changed forever this time? Or is there another way to detect that the frame is not finished?

0 Kudos
Message 6 of 8
(3,343 Views)

Please provide the exact format of the data you are reading. If, for example there is a termination character, you don't have to wait and you don't use the VISA Bytes at Serial Port at all. You just specify some large arbitrary number of bytes to read.

0 Kudos
Message 7 of 8
(3,339 Views)

This is the format in hexa 7E00 2288 014E 4400 D083 0013 A200 406E 8234 204E 4F44 4F31 00FF FE01 00C1 0510 1E00 0200 0003 7E00 2188 014E 4400 7ACD 0013 A200 406F F4C4 4E4F 444F 3200 FFFE 0100 C105 101E 0002 0000 2B. In this frame were reported two devices. The frame of each device begins with the rest are 7E byte data of each frame that is determined by API protocol Xbee.

 

Thanks a lot

0 Kudos
Message 8 of 8
(3,336 Views)