Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

serial data from microtec systems torque meter

Hi

 

I am trying to read the data coming out of a torque meter, (microtec systems MT-TRA1000).

 

I have no trouble getting the data into my labview, so the I know my serial setting are correct.

 

my problem occurs with the data it's self, reading from the serial port I can obtain the following

 

-00.00a+0000.0d

where the first reading is the torque (a) and the second is the angle(d). This was gathered by simply setting the 'bytes to read' to 15.

 

However the data is streamed constantly from the meter to the com port and the following randomly occurs

 

0000.0d-00.00a+

 

This is most unwelcome as it give false readings.

 

Increasing the number of 'bytes to read' reduces the problem but does not solve it.

 

Can any one help?

Do i need to sync / lock the data?

 

Many thanks

Jamie Sayers

 
0 Kudos
Message 1 of 7
(4,528 Views)

Please see attached vi

 

0 Kudos
Message 2 of 7
(4,522 Views)

I can't open you sample, however here are some thoughts:

If your device send continiusly data, the trick is to sync to the/a  termination character if possible, and setup the VISA read until that termination character

Read 90 bytes and have a look at the output string. Are there termination characters send? (switch the diplay to '\-code' mode)

are there /r or /n or both? choose the last char send.

at least you can use the 'd' character.

Oh the termination char and mode of VISA can be set with the propertys (open bytes at port, select the termination properties, and set them to write)

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 3 of 7
(4,504 Views)

Hi Henrik

Thanks for the reply, I have tried syncing on the 'a' and the 'd' by setting the termination character to hex 61 and 64, this did not work all that was returned was random characters

I have changed the output string to display '\code' and below are 90 bytes read back, the data does not contain any standard termination characters.

d-00.03a+0015.9d-00.03a+0015.9d-00.03a+0015.9d-00.03a+0015.9d-00.03a+0015.9d-00.03a+0015.9#

I have all so changed the attached vi to open in labview 8 and 8.2.

Regards

jamie

0 Kudos
Message 4 of 7
(4,493 Views)

Jamie,

Why not use the "Search/Split String" function to always find the character "d" in the buffered data.  Then you know where you are in the stream of data.

0 Kudos
Message 5 of 7
(4,484 Views)

Hi,

  another alternative, especially if you're finding that occasionally the data is coming back different, is to read a character at a time (obviously depending on the rate of incoming data) and then you can doa  quick piece of analysis to say if you have the whole message as you'd expect it. (Us a shift register to maintain the string message whilst you haven't hit the end of the message). You can try to do a scan from string, and if you get an error saying it's not matched, then you know the formatting isn't complete yet.

Hope that helps

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 6 of 7
(4,464 Views)

Thank you all for replies

I have found the solution scanning for the 'd' character

Regards

Jamie

 

0 Kudos
Message 7 of 7
(4,427 Views)