I'm not a computer ingineer, so my knowledge is basic.
I 'm trying to read the value of a counter on Labview (7.1), via a serial port.
Here is the Visa config. of the counter:
- Baud rate: 4800
- Parity : even
- Stop bits: 1
I need to send first a message (Visa Write), then It'll answer me (Visa read). Is it the right procedure?
I receive an error "1073807253", which mean that the "visa serial" isn't well connected But I've checked evrything and it seem rigth.
Please help me out.
You may not be giving the counter time enough to respond. Place a 100-200 ms wait function after you write the command to the instrument.
you should at first clean up your VI:
- After doing so you should check the display type of all string constants and indicators. As I switched on "display mode" for those string constants I noticed they are not the same…
- Then you have configured SerialPortInit to use LF as TermChar. Does your device support such TermChar? If yes: use it by requesting slightly more bytes for VISARead then the device will likely send in it's answer to your request.
- Please check the device's manual for any required TermChars in the message as you have to append them on your own! In case the device is waiting for some special TermChar you
will may not receive any answers…
Error -1073807253 is a framing error. I wonder if the problem is the first item in you Concatenate Strings. The first item shows as 02 but you are using Hex Display for that constant so you're seeing the ASCII value in hex, which is an unprintable character. The other 3 items are Normal Display so you are seeing the actual text that will be sent. Perhaps you need to change the first item's display type to Normal and then type in 02. Try that and see if it helps.
and what about all those other suggestions/comments?
I think my error comes from the message I send, I need to send : STX .. .. ETX (start text, counter ID, address, end of text). But I'm not sure in which language, I've tried Hex (02 30 30 03) and ASCII (2 48 48 3).
I've tried to simplify the message I send by sending everything in 1 string.
But I still have the same error.
What is a framing error? (from the forum, it seems to be a communication problem as it often comes from the cable)
I haven't tried TermChars, I'm not sure ow to use them.
Again, you are not sending what you think you're sending. Right now the "02" constant has a hex display mode and the rest are set to normal mode. That means you are sending one less ASCII character than you think and the first character is an unprintable character not an ASCII-HEX character as it appears to be on the block diagram. You may or may not need spaces in your text string as well but first try deleting and recreating the four string constants.
the counter is a Baumer NE214
I send you the "serial port utilisation guide" (sorry it's in french). what we're interested in is §2.1, my counter ID and adress are both 0.