LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

counter

Hi,

 

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.

0 Kudos
Message 1 of 19
(3,166 Views)

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.

PaulG.

LabVIEW versions 5.0 - 2023

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 2 of 19
(3,136 Views)

Hi Pierre,

 

you should at first clean up your VI:

check.png

- 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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 19
(3,125 Views)

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.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 4 of 19
(3,106 Views)

I'v tried to include  a timer 200, 500 & 10000 ms. bt it doesn't change anything

0 Kudos
Message 5 of 19
(3,081 Views)

Hi pierre,

 

and what about all those other suggestions/comments?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 19
(3,079 Views)

Hi,

 

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.

 

Best Regards

 

Pierre Samson

0 Kudos
Message 7 of 19
(3,051 Views)

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. 

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 8 of 19
(3,044 Views)

What is the make and model of the counter?  Do you have a manual for it?

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 9 of 19
(3,029 Views)

Hi,

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.

 

Best Regards

 

Pierre Samson

0 Kudos
Message 10 of 19
(2,997 Views)