02-25-2014 06:33 AM
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.
02-25-2014 12:10 PM
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.
02-25-2014 01:08 PM
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…
02-25-2014 02:58 PM
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.
02-27-2014 03:03 AM
I'v tried to include a timer 200, 500 & 10000 ms. bt it doesn't change anything
02-27-2014 03:10 AM
02-28-2014 07:43 AM
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.
02-28-2014 07:56 AM
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.
02-28-2014 09:40 AM
What is the make and model of the counter? Do you have a manual for it?
03-03-2014 03:40 AM
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.