08-16-2014 02:00 AM - edited 08-16-2014 02:02 AM
What did you change based on what you learned from your test VI? (my first suggestion in post 73) Could you post your new version of the VI after you make these changes?
Also, here is an example on how to use probes (instead of creating indicators): https://www.youtube.com/watch?v=5gEy0ef_2OU (In your case you probably shouldn't turn on "Highlight Execution" which is teh lightbulb button).
08-16-2014 02:11 AM
Thanks for the video link. I know how to use it in development PC but in remote PC how can I see these values? So I thouht of using indicator?
Attached VI in which read array will show all the reposnse of arduino. read/ write arduino will show the current values
08-18-2014 09:36 PM - edited 08-18-2014 09:37 PM
I tried adding 100ms delay in between two consecutive transcation(read+write). This also didnt worked.
One more thing I wanted to make here. I am getting timeout in VISA read but not VISA write as first I do VISA write then only I do read. String I am writing to VISA write is OK.
08-18-2014 09:49 PM
08-18-2014 10:21 PM - edited 08-18-2014 10:22 PM
May be becasuse VISA write is actually our PC buffer which is always connected? Its a job to arduino to read that buffer by polling continously or by interrupt?
Is it so?
08-18-2014 10:24 PM
How are you connecting to the Windows XP computer? If you have access to the block diagram on that computer then you can use probes.
Have you tried hardcoding just a single command to be written to the Arduino? Simply hard code the "*AA$" write with 4 for the byte count on the VISA read.
08-18-2014 10:33 PM
@Nathan_B. wrote:
How are you connecting to the Windows XP computer? If you have access to the block diagram on that computer then you can use probes.
Have you tried hardcoding just a single command to be written to the Arduino? Simply hard code the "*AA$" write with 4 for the byte count on the VISA read.
Yes I wrote one simple VI only write *AA$ and read response. I tested for 4000 times and it worked. here is my VI attached. one more thing I should point out here.
*AA$ *A0$ *A050$
In this response response may very from 0 to 50. Now all time I get is 0 i.e. total 4 bytes. when I read using VISA read then I get timeout error here because I have to read at the max 5 bytes but I actually read 4 mostly. So next time it fails. Is this causing problem? I also cant use $ as termination character.
08-18-2014 10:35 PM - edited 08-18-2014 10:39 PM
I know you did it in a separate VI already. That is why I asked if you hard coded those things into your main VI. Try this.
If you are supposed to be reading 5 bytes but only read 4, that will always be a problem. The easiest way to handle this is to make sure that the output will always be the same number of bytes. Then you simply read all the bytes. You can do this by always requiring a 3 digit number be returned (e.g. 001, 002, 045, 050). Otherwise, there might be a way to keep reading bytes until they are no longer available but I'm not too familiar with this technique with VISA in LabVIEW.
08-18-2014 10:42 PM
@Nathan_B. wrote:
I know you did it in a separate VI already. That is why I asked if you hard coded those things into your main VI. Try this.
If you are supposed to be reading 5 bytes but only read 4, that will always be a problem. The easiest way to handle this is to make sure that the output will always be the same number of bytes. Then you simply read all the bytes. You can do this by always requiring a 3 digit number be returned (e.g. 001, 002, 045, 050).
You want me to send each time *AA$ and read 4 bytes in this VI only right? If so will do. does this inbetween timeout can cause issue?
No here I am supposed to read 4 only but sometime it can be 5 bytes. The method of reading and format I cant change as this is standard for us. I can handle in other way around
08-18-2014 10:50 PM - edited 08-18-2014 10:50 PM
@Ranjeet_Singh wrote:
You want me to send each time *AA$ and read 4 bytes in this VI only right?
Yes, I said to try that.
@Ranjeet_Singh wrote:
If so will do. does this inbetween timeout can cause issue?
Isn't that what we are trying to figure out?
@Ranjeet_Singh wrote:
No here I am supposed to read 4 only but sometime it can be 5 bytes. The method of reading and format I cant change as this is standard for us. I can handle in other way around
If you are unable to change the output, you need to account for that in LabVIEW. If you only read 4 bytes and the actual return value is 6 bytes long, you will be missing information. You need to read ALL of the bytes that are returned by the Arduino if you want to have a system that works.