07-06-2020 09:46 AM
My project is attached. Thanks
07-06-2020 08:47 PM
I give up! There is no working LabVIEW program to examine in the file you attached. I cannot provide any more help.
Bob Schor
07-06-2020 10:41 PM
I attached a .zip file which must be uncompressed with winrar. Inside just open PROJECT.lvprj thats all. I have Labview 2017. 😞
07-07-2020 08:03 AM - edited 07-07-2020 08:12 AM
I wouldn't you have attached a true zip file that could be unzipped and opened with native Windows file explorer?
EDIT: Actually it is a true zip file that can be opened with Windows Explorer. It is missing a subVI called "Loop Frequency.vi".
I do see a problem in VISA Read Multiple Channels, where you are using "Bytes at Port" which is wrong 99% of the time. You send a command "z", then immediately check Bytes at Port and try to read that many bytes. I bet it is 0. How fast to you think your device is that it could read the command and respond back with a full message before your PC moves onto checking the number of bytes? A quick fix is to put a wait in there before checking the number of bytes. The real fix is to use a real serial protocol that has a defined number of bytes, or ends with a termination character. Why don't you read 14 and throw away "bytes at port" since you define that a valid message as a length of 14?
Also, no need to wire all of those index constants on Index Array. By default they'll be 0, 1, 2, 3, .....
07-07-2020 09:57 AM
Thank you for the reply.
I actually send from Arduino a termination character '\n', do I have to modify termination character when I initialize serial port?
I will try your fixing options, when I have searched in internet about serial protocols I havent been lucky. I just have experimented with it.
Loopfrequency.vi... I dont remmember but the main vi its there.
Well thank you so much. I hope Bob could open the zip file 🙂
07-07-2020 01:30 PM
@yamelbio wrote:
Thank you for the reply.
I actually send from Arduino a termination character '\n', do I have to modify termination character when I initialize serial port?
The default for a VISA serial initialization is to enable the termination character and set it for \n (line feed, AKA new line). I don't see where you initialize the port in your code so I don't know if you did something different.
07-07-2020 10:09 PM
Yes. I inicialized serial port with termination character '\n'.
The last values I send from Arduino are 13 and 10 --> '\n'.
I did tried what you suggested me but the frequency does not go higher than 250 Hz. With my code it gets 1000 Hz...I really dont know why...I am a noob on serial communications.