05-08-2023 08:39 AM
Hello I need to send this long hex value to a serial device to trigger it. Its a scanner and and i am trying to do one of the operations, the operation here being change the led colour in it to green. So in the document this is what is mentioned.
Controls the LED indicators This command turns on/off or restores one of the three LEDs, Red LED, Green LED, and Blue LED. Please note that LED Indicators can not be set to the default value by Factory Default or Master Default. Available for Bluetooth F, L & A series and Tethered F, L & A series Packet Format Prefix Opcode Status Length Parameter(s) LRC Suffix 7Eh 80h 00h 00h 00h 00h 02h SeeVariable 7Eh 1 Byte 3 Bytes 1 Byte 2 Bytes 1 Byte 1 Byte 1 Byte . Host Requirements If the device successfully received the above command issued by the host, a “Device ACK” will be sent to the host right after the device performed the action. Otherwise, a “Device NAK” will be sent to host to issue a command error. However, if the host can not receive any response from the device within the user preset time-out duration, please resend the above command. . Length Total size (bytes) of the Parameter(s) field . LRC ”Opcode” XOR “Status” XOR “Length” XOR “Parameter(s)” Parameter(s) < Table 1-0 > LED Indicator Parameter(s) Field Parameter / PID / Size Options Descriptions LED Indicator PID : Size : 00h 02h (2 Bytes) 1 st Byte - 01h - 02h - 03h 2 nd Byte - 00h - 01h - 02h LED Selection Red LED Green LED Blue LED LED Status OFF ON Restore to system control.
So I wrote this program and send the value 7E80000000000202807E to the device. But nothing is happening. So i need to know is there something wrong with the program. Because the device connected is ok. I checked in NI Max where the device is connected and clicked Visa Validate and it shows connection ok. I removed the device and clicked Validate and shows not ok. I have taked screenshots of both of this and uploaded it. I have also uploaded the program. Can anyone let me know what is exactly wrong with the problem. I have also uploaded the pdf of the scanner. The thing I am trying to do is in page 26. Kindly go through the program and help me. Thank you.
05-08-2023 09:23 AM - edited 05-08-2023 09:34 AM
Set all your string inputs to hex display and re-enter the data. (right-click...hex display)
(There is a big difference between hex formatted text and a binary string displayed in hex.)
I did not look at the manual or your complicated descriptions, but here's a quick rewrite. Modify as needed.
05-09-2023 01:26 AM
Hi,
I have made the changes. Can you confirm this is correct. By this I meant the hex string value which is being sent to the device. Ignore the VISA part. So if the hex string is correct format and everything then the problem is with the value I am sending. So I need to understand what the problem is by contacting directly the manufacturer. So kindly confirm the hex format is correct. Thank you.
05-09-2023 04:35 AM
To my opinion there is a problem in their document.
They want 2 bytes in the Table 1-0 but they wrote 1 byte in the string.
Your string :
7E prefix
800000 op code
00 status
0002 lenght
02 Parameter
80 LRC
7E suffix
My interpretation of their document :
7E prefix
800000 op code
00 status
0002 lenght
0201 Parameter
81 LRC
7E suffix
You can try that.
05-10-2023 09:56 AM - edited 05-10-2023 09:57 AM
@defaphe, I already tried that after reading the document and its not working. I will try to contact the manufacturer for more help.