10-05-2021 01:08 AM
Hello all
I am working PCAN interface , where i need to read the CAN signal and display the response HEX value on the String indicator ,now i am able to read it but the data i want to display one after another with time .
the data i am expecting is 80000000, but i am receiving as 80 0 0 0 0 0 0 .
could you please tell me what i am doing wrong .
Solved! Go to Solution.
10-05-2021 01:41 AM - edited 10-05-2021 01:47 AM
You should be more precise in specifying values. One may wonder whether you are expecting 80000000 represented as ASCII (8 bytes '8', '0', '0', '0', '0', '0', '0', '0', each byte being a character) or as hex (4 bytes 0x80, 0x00, 0x00, 0x00). I guess the latter.
From the picture of the output, first read, you are receiving 8 bytes (0x80, then 0x00 7 times). In the second read, something goes wrong (?) and you receive 9 bytes, with the 0x80 doubled. Third and subsequent reads: 0x00, 0x80, then 0x00 7 times.
No idea why this happens, since I know nothing about the device you are using.
EDIT: also remember to show the display format of string controls/indicators.
EDIT2: if you want to display '00' instead of '0' for a null byte, you should input 2 as width instead of 1 to the formatting function.
10-05-2021 03:45 AM
Anil@8899 wrote:
Hello all
I am working PCAN interface , where i need to read the CAN signal and display the response HEX value on the String indicator ,now i am able to read it but the data i want to display one after another with time .
the data i am expecting is 80000000, but i am receiving as 80 0 0 0 0 0 0 .
could you please tell me what i am doing wrong .
Your For-Loop is wrong. Try doing it like this instead:
10-05-2021 08:47 AM - edited 10-05-2021 08:48 AM
Hi Dobrinov,
@Dobrinov wrote:
Your For-Loop is wrong. Try doing it like this instead:
What's the point of a FOR loop at all in this example?
Why not go without a loop?
10-05-2021 08:55 AM
@GerdW wrote:
Hi Dobrinov,
@Dobrinov wrote:
Your For-Loop is wrong. Try doing it like this instead:
What's the point of a FOR loop at all in this example?
Why not go without a loop?
I modified the loop he already had in place - much easier for him to figure out what to change to make it work. That and I'm lazy, so less effort for me.
10-05-2021 11:48 PM
Thanks for your reply ,
I modified as per your comment , but i wanted to display the response continuously , because to keep the track of previous response .plesae guide me ...
thanks ..
10-06-2021 01:06 AM
Anil@8899 wrote:
Thanks for your reply ,
I modified as per your comment , but i wanted to display the response continuously , because to keep the track of previous response .plesae guide me ...
thanks ..
If I even understand your request correctly then try this:
10-06-2021 01:26 AM
Hello Dobrinov,
Thank you very much for your time and support .
it is working properly .
10-06-2021 01:34 AM
Hi Anil,
Anil@8899 wrote:
it is working properly .
I don't think so…
You surely need to improve your VI…