11-09-2021 07:14 PM
Hi, all
I installed the VIA USB driver and can find the printer hardware, but I can read out the return value via NI MAX test panel, but write command is successful, please kindly refer attachment, it's also return error when i use the VISA VI read,can you help me ,thanks
11-09-2021 09:26 PM
You are receiving the timeout error. Since you are trying to read 1024 bytes of data, the data is not received within that specific timeout. Either try to increase the timeout or set the bytes to read to appropriate byte size of data which the printer is sending.
11-09-2021 10:17 PM
I tried the appropriate bytes data but still error , i used NI MAX test panel can't read out the data
11-09-2021 10:22 PM
you can refer the new test VI to read data
11-09-2021 10:45 PM
share the serial communication command list pdf. Which command are you sending??
11-10-2021 01:00 AM
Please refer my VI, command is hexadecimal,4D3C 2B1A 0F0C 0300 1301 00,this command sent using C# is OK, and return value as below:
D:\Lenovo_Image\TestPlan\Program\FCT\Alpha PRN\USBbackend.exe /f 00
Send to USB 11 bytes
0x4d 0x3c 0x2b 0x1a 0x0f 0x0c 0x03 0x00 0x13 0x01 0x00-----this is send command
Get from USB 12 bytes
0x4d 0x3c 0x2b 0x1a 0x0f 0x0c 0x04 0x00 0x13 0x02 0x00 0x02----read from printer
11-10-2021 02:54 AM - edited 11-10-2021 03:03 AM
So your response to receive is supposed to be 12 bytes but you try to read 15 bytes?
Where o where is there a difference?
Also if you insist on posting pictures of your code rather than the actual VI, please from now on make the string type glyph visible. The only way to guess that your string constant is actually in binary Hex format is from the formatting of the string, but it could just as well be a normal string formatted that way, which your printer would have no idea what to do with.
A more versatile routine to read the response would be however to first read 8 bytes of data, compare the first 4 bytes with the Magic ID to verify that you got a valid response, take the next 2 bytes in little endian as indication what command response it is for, then interpret the last two bytes as a little endian U16 that tells you how much more data to read. At least for the command and response you show this seems the format.
11-10-2021 03:48 AM
can you help to send a versatile routine ? I'm sure it's send the hexadecimal string, thanks
11-10-2021 03:53 AM
I tried lots of read bytes ,since the different command maybe feedback different bytes,thanks
11-10-2021 04:25 AM
Read 8 bytes or 2 bytes ,the same error return (Hex 0xBFFF0015)..thanks