LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

my test instrument is outputting a 5 line string but labview only read until the carriage return. how can I get it to read the whole string?

I have a labview sub-VI reading the string being outputted by a pH meter.  The meter outputs a 5 line string and labview is only reading up to each lines carriage return, there-by giving me 5 separate strings is there anyway to rectify this and have the 5 line read as one string?
NAS1
St Petersburg FL
Labview 2010
0 Kudos
Message 1 of 11
(3,358 Views)
Hello,
 
send me the string and send you an example. Tell me your labview version
Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 2 of 11
(3,354 Views)

Jorge,

 

This is the string I get:

                          74923

03/07/2008 10:25 AM

A  SM 77.0F     7.00 pH

03/07/2008 10:25 AM

B  SM 77.0F     7.25 pH

 

First line is sample number, next line date and time, next line sample probe A, next line date and time, last line sample probe B

The my "string read" dialogue box on my sub-vi only reads one of those lines at a time.

Nate

 

 

NAS1
St Petersburg FL
Labview 2010
0 Kudos
Message 3 of 11
(3,343 Views)

Jorge,

The Labview Version is 7.1.  Thanks for your promt response

 

Nate

NAS1
St Petersburg FL
Labview 2010
0 Kudos
Message 4 of 11
(3,342 Views)
When you use the VISA Configure Serial Port, one of the inputs is called 'Enable Termination Character (T)'. The default for this is True and the default termination character is hex A or the LF character. With term character enabled, a VISA Read will automatically terminate when the term character is detected. Set the input to false and use the VISA Bytes at Serial Port to determine how many bytes to read.
Message 5 of 11
(3,334 Views)
After talking to the original developer of the sub-vi, he said though I'm currently using 7.1 the sub-vi was written using labview 6 and serial read.vi were used not VISA's.  I can go through and modify the Vi to use VISA's but if someone can help me resolve this issue using the legacy vi's.  I would appreciate it.  Thanks for the info Dennis
NAS1
St Petersburg FL
Labview 2010
0 Kudos
Message 6 of 11
(3,310 Views)
If you are using 7.1, then you are already using VISA. The old serial functions are now a wrapper around VISA calls. Support for the old serial drivers was completely dropped with 7.1. Open up the functions you are using and look at the block diagram. If they don't have VISA functions inside, then somehow you managed to avoid the correct upgrade to 7.1.
Message 7 of 11
(3,304 Views)

Dennis,

Using 7.1, I am looking at the block diagram and it is still using "Serial Port Read.vi"  Not a VISA.  I don't know how but it is.  And so are the other sub-vi's for several other serial meters, and they are picking up single line strings with no issue and submitting thier output to the main VI.

Nate

NAS1
St Petersburg FL
Labview 2010
0 Kudos
Message 8 of 11
(3,300 Views)

Dennis,

Should Labview have converted my serial port read.vi and other out of date vi's to the new visa format?  I doubt it.  These were written on LabView 6 and then are being modified and run in 7.1.  I didn't realize that newer versions of Labview wouldn't support the older version programs. 

Nate

NAS1
St Petersburg FL
Labview 2010
0 Kudos
Message 9 of 11
(3,299 Views)

Yes, LabVIEW will automatically update. What happens is that the old serial functions still exist in 7.1 and above but the code (the block diagram) has been modified to use VISA functions. Older versions of LabVIEW are fully supported in this manner. The only way you can avoid the automatic update is to have the old serial functions in an llb and your top level VI refer to these. Having any VI that was part of vi.lib in an llb is a very bad idea and the way to fix things is to remove any VIs in the llb that are part of the LabVIEW distribution.

I don't remember how the old serial config worked and what the new version does with the VISA Configure Serial Port. Your program should only have a single serial config and you might just be able to directly replace that with the VISA configure Serial Port.

Message 10 of 11
(3,286 Views)