Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get data in serial communication

I add my old rs232 test vi ..

run the vi, start with settings in the picture and set the right com and switch to online...

The command string inputs and the output string display can be set (on the fly) to different output styles ... just play 🙂

comtestersettings.png

 

 

I browsed the manuals but no details for the serial commands... but you should ask anritsu for that documentation ...

If you know some commands .. remember that some devices may wait for termination character like /LF or /CR /LF 😉

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 11 of 24
(690 Views)

I am very sorry for the delay in my reply!
We received the communication protocol from the manufacturer of the measuring instrument we use, but I'm sorry I can't show it to you right away because it's not open data.
We have asked the manufacturer and are waiting for permission.
We will contact you as soon as we receive a reply from the manufacturer.
Thank you for your cooperation.

0 Kudos
Message 12 of 24
(670 Views)

I am very sorry for the delay in my reply!
Thank you very much for providing the test program.
I would like to ask you a question.
When I enter a command in the area circled in red, does the command return in the area circled in blue?
Also, is the yellow area where you select the terminating character?
The command terminator is /r. In that case, should I select x0D CR?

スクリーンショット 2021-10-04 12.00.40.png

0 Kudos
Message 13 of 24
(667 Views)

The red one is an string indicator only.. no chance to enter a value while running the vi 😉

in the blue field on the left you can enter your (list) command(s) (string control) , they will be send if you press the according SEND button

 

the display style of the string control (and indicator) can be choosen on top of it...

the data shown will be the same, just the way it is displayed will change  

 

to send a command I would choose '/-Style' for the string (write) control and enter COMMAND/r

 

for testing I would always turn off termination character ...  (all data send to the PC via serial will show up in the red indicator anyway 😉

later if you know the details of the protocoll used, you can (and usually should if possible) use it.

Pittfall with termination character: if compressed data is send (raw binary) it could contain the termination character too 😉

 

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 14 of 24
(648 Views)

I am very sorry for the late reply.
I have posted a picture of the sending and receiving commands.
I overlooked the commands in the protocol.
If you send the "DATA" command after sending the "START" command, it will be sent in hexadecimal.
However, I'm having trouble with "Simple Serious", because I need to send the command from here one by one.
How can I create a program that measures in real time the moment the measurement starts?

Translated with www.DeepL.com/Translator (free version)

スクリーンショット 2021-10-11 15.46.49.png

スクリーンショット 2021-10-11 15.47.36.png

0 Kudos
Message 15 of 24
(629 Views)

I am very sorry for the late reply.
Thank you for explaining the program. I tried it, but could not send/receive properly.
Do you write the end character in the text box?

0 Kudos
Message 16 of 24
(625 Views)

Here is a startpoint ... run the vi, set the com port and ...   ,set Write to /-  , enter the strings

comtestersettings2.png

 

hit the top send button to send START\r (\r is x0D), followed by the other ones ....

if you see some replys in the read indicator .. hit Save read buffer , choose a filename and post it here

 

to bad we don't have the complete protocol manual ...

if you change the Read or Write format (anytime while the vi is running) you just change the visual presentation... no data is changed. However in ASCII format not all data is visual 😉

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 17 of 24
(618 Views)

here is a conversion vi ... just by looking at it ..  no check if data is valid or some data is missing 

just take the first 6 byte (characters) form it into 3x  I16 and divide by 10

maybe there are checksums etc ...

hex2Temp.png

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 18 of 24
(616 Views)

if the device measure and sends 103.7 (x040D), 78.1 (x030D), 52.5 , or some other temperatures (333°C ...) , the binary format will include the x0D character, so I think it's not possible to use the termination character in the serial configuration

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 19 of 24
(613 Views)

@Henrik_Volkers wrote:

here is a conversion vi ... just by looking at it ..  no check if data is valid or some data is missing 

just take the first 6 byte (characters) form it into 3x  I16 and divide by 10

maybe there are checksums etc ...


We can simplify that quite a bit by using the Unflatten From String.  Here I can directly convert to a cluster of 3 I16 values from the string and then divide by 10 to have a cluster of the temperatures.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
Message 20 of 24
(606 Views)