02-23-2015 07:06 AM
Header |
Message Info |
Period |
Not Using |
||
0xAB |
0xCD |
0x0A |
Period Low Byte |
Period High Byte |
0x0000 |
0xBC |
|||||
0xDF |
-set period=1=> my code: “AB CD 0A 01 00 00 00” PC sending to Device
-period is ok response code: "DC BA A0 00 01 00 00" Device sending to PC
-Start measure code: "AB CD BC 00 00 00 00" PC sending to Device
-Example Measuring: "DC BA D0 XX XX 00 00" Device sending to PC
"DC BA D0 XX XX 00 00" Device sending to PC
"DC BA D0 XX XX 00 00" Device sending to PC
"DC BA D0 XX XX 00 00" Device sending to PC
-Finish measure code: "AB CD DF 00 00 00 00" PC sending to Device
I can do that with any SerialPortCommunication programs. But not with labview.
bytes at port value zero
Solved! Go to Solution.
02-23-2015 07:50 AM
You are supposed to send the binary representation of the Hex values, not the ASCII characters hex numbers. You are sending the ASCII character 'A' (which is 1 byte) instead of the numeric value in hex (4 bits).
Use an array of U8's - each one containing the hex pairs and then use array of U8 to string to send over serial.
Like this:
02-23-2015 07:56 AM
02-23-2015 07:56 AM
02-23-2015 08:21 AM
Oh yes, I had forgotten you could do that nathand. Thanks for reminding me!
02-23-2015 08:46 AM
Thank you now i can read data from my device but my read data is:
0000 DCBA 0DE1 3000 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00DC BA0D 56F4 0000 DCBA 0D56 F400 00
for one itteration and my period is "10". Why its not synchronize. You can see serial communication program from attachment. And my vi.
I need read data like serial comminication program.
02-23-2015 09:15 AM
Thank you. Now i can read data from my device. But its still not synchronize.
How can i get datas like serial communication program (in attachment ss.png)
02-23-2015 09:22 AM
Do NOT use the Bytes At Port. That can easily throw things off unless you have your waits just right.
So let's look at your data structure. It looks like there are 7 bytes in each message. So just set the number of bytes to read on the VISA Read to 7.
02-23-2015 09:38 AM
Don't use the Bytes at Port method immediately after a Write. Use a small wait statement in there to give the device time to read the message and output a full reply. Then you can use Bytes at Port to determine how long the reply is and read it.
02-25-2015 01:55 AM
Thank you all. Now its working perfectly.