12-20-2017 09:14 AM
I´m not sure if i´m right with my question.
I want to test a device with RS485 and need an example for the command
Command Frame Image
DMY/STX/ID/Command data/EXT/BCC
DMY: Dummy data: 7Fh
STX : Start text: 02h
ID: Slave ID [2bytes]: (ASCII)
Command data: Variable length data: (ASCII)
EXT: End text: 03h
BCC: BCC error detection between ID and EXT (1 Byte)
Command Code example "03" for INQUIRY (Reading)
Communication with Standard RS232 devices is no Problem for me. But These are clear ASCII commands.
What for a string must i build for a INQUIRY command?
Thank you very much in advance
12-20-2017 09:19 AM
Hi Moby,
are you related with NGHIA?
Apparently you want to use the very same communication protocol…
Read the manual attached by NGHIA, it describes the strings quite nicely. All you need to add is to put that DMY byte in front of the remaining string…
12-20-2017 11:32 AM
I answered in wrong topic.
I'm Not related to the other User.
But it's a japanese device,too.
I will Check. For the Moment in need a rs485 USB Adapter. I only have rs232 connectors and Adapter.
Must i build an String with Hex values?
12-20-2017 12:33 PM
12-21-2017 08:32 AM
RS232 to RS485 converters are pretty common in our lab. It would probably be more reliable to get a dedicated RS485 device, but we've used a couple converters like this one, and this one. One works without power, just requiring two wires somehow. The other I found needed a 12V adapter, but both work well for our low speed environmental chamber control.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-07-2018 07:31 AM
I´m sorry for late Reply. I was ill and some other things to do.
Now i tryed to get a simple command:
inquiry--->command code "03" It´s reading command
My adress is 01
But i don´t get back any feedback. I think something is wrong in command string?
02-07-2018 07:40 AM
Hi Dicker,
I made the display style indicator visible for all string constants (as suggested before!):
Do you see the difference between them?
I think something is wrong in command string?
Yes, you are right!
- You need to set the string constants to hex display to be able to input correct values…
- you need to calculate the correct BCC value, trying to append an empty string is plain wrong!
- there are no error wires in your VI!
- using the default TermChar is wrong for this kind of communication…
- are you sure you need to read 20 bytes from your device?
02-07-2018 08:34 AM
Hello Gerd,
yes i see the different in style and i read it before. But this versionw as wanted (seems to be wrong)
According to my Manual ID and command data are ASCII and not hex values. Now i don´t know how to handle.
Error wires are now connected. Cluster constant at Input and a Display output at visa read.
I reduced the reading buffer to 4 (Manual)
About term char: I had no Information in Manual. So i didn´t Change it. Now i set it to false.
BCC is also difficult to understand: It´s calculated in the Response between/including "ID" "RES" "DATA" "EXT"
-->ID=2bytes
-->RES=2bytes
-->data (for inquiry command) = 4bytes
-->EXT= no Information
Now i´m thinking i must add "8" as string?
My error out is "-1073807339" It´s meaning time out at "reading"
Best regards
02-07-2018 08:47 AM
Hi Dicker,
Now i´m thinking i must add "8" as string?
Why do you think so? Just because there are 8 bytes???
There should be a description in your manual telling you how to calculate the BCC. (Sometimes they just XOR all bytes…)
02-07-2018 09:06 AM
Good afternoon Gerd,
I will Check the calculation again.
If i will mit find any Information i will ask manufacturer in Japan.
For the Moment i only counted the Bytes.
What's about my String Hex Problem?
Is PDF Upload here possible, 2-4pages?
Best regards