LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question regarding serial communication development

Hello,
hope you should help me.

I have to communicate with a matrix audio video switcher, able to
be managed via RS 232.

I tried to create many vis to perform it but unfortunately it did not
work 😞

First, I used VISA Write command to send 4 bytes to the instrument, it
works fine, but while data sent were a string, my switcher received
ascii and didn't recognize my command.

Second, I used Out port command, nothing was sent to my serial bus.

I found many other integrated visa function, but I was not able to use
them properly...

Should anyone be able to help me?

Thanks in advance.

Olivier
0 Kudos
Message 1 of 4
(2,654 Views)
Oliver,

some hints:
a) You should use the VISA vis not the Outport!
b) A string is just an array of bytes

1.Open the 'Serial Communication.vi' Example (Help-Find Example)
2.Save it as your own copy with a different name,location (with aktiv checkbox 'save a copy without updating callers'), close example,open your copy
3. If needed add controlls to your vi for the correct initialisation of the serial port. if you get responses as raw binary values, make shure all termination characters are turned off.
4. right click the write-string control (and read string indicator) and choose the display style you need (for raw data maybe hex? I prefer '\-code' read online doc for more help)

5. give it a try

Greetings from Germany
Henrik
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 ǝɥʇ'


Message 2 of 4
(2,654 Views)
Olivier wrote:

> Hello,
> hope you should help me.
>
> I have to communicate with a matrix audio video switcher, able to
> be managed via RS 232.
>
> I tried to create many vis to perform it but unfortunately it did not
> work 😞
>
> First, I used VISA Write command to send 4 bytes to the instrument, it
> works fine, but while data sent were a string, my switcher received
> ascii and didn't recognize my command.

The serial-comms VISA vi's can only send data. But A String is basically
an array of bytes. So if you want to send binary date (numbers) just
fill an Array of U8, convert it to a string with the function Array of
U8 to Strin and it should be done.

Hope this helps

Marco Tedaldi
Message 3 of 4
(2,654 Views)
Hi all,

I'd like to thank you very much for your answers, indications you gave
me permitted a good use of data send 😉

Kind regards,

Olivier
0 Kudos
Message 4 of 4
(2,654 Views)