09-01-2015 04:52 AM
Hi all, I am new to serial comms with RS485. I have watched video and managed to create Visa Resource Name (to configure the comms setting), Visa Read, Visa Write and InstruProperty (to determine the byte size and pass it to Visa Read).
My instrument connector is RS485 and I am using a RS485-USB convertor. I have a protocol manual from the OEM which I dont understand how to write the message to write to the instrument and to receive the reply.
The following is an example stated in the manual:
PC Request to instrument:
<0xAA> Prefix
<0x00> LENHi
<0x0A> LENLo
<0x00> Client
<0x01> NameTr
<0x01> NameRx
<0x00> STATUSHi
<0x00> STATUSLo
<0x0B> CODE
<CS> Checksum
So, how should I type into the Control for the Write Buffer (Visa Write)
Thank you.
09-01-2015 05:05 AM
Hi kwai,
create an U8 array, change the numeric display to HEX and type in the values:
You need to calculate a checksum and append that to your message.
When you have different messages you might want to replace HiLen and LoLen values using ReplaceArrayElements…
09-01-2015 05:09 AM
Hi,
Do you mind sharing your manual ?
09-01-2015 05:16 AM
Hi,
Not at all. Please see the attached manual for the protocol comms. Thanks
09-01-2015 05:40 AM
you already got the answer above
09-03-2015 03:58 AM
Hi GerdW,
I will have been writing to the sensor but did not receive a reply from it. I even tried using Hyperterminal but also did not work.
What is wrong with the following code:
0x0A 0x00 0x0B 0x00 0x00 0x01 0x00 0x00 0x0B 0x00 0xDF
Please help. Much appreciated. Regards
09-03-2015 04:11 AM
Why the 0x00 before the 0xDF? Assuming I am seeing the command you are sendinfg, the manual indicates an 8-bit checksum. Looks like you are sending a 16-bit checksum. Also, the manual has a Prefix of 0xAA, not 0x0A.