LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA_ARDUNO_CHANNEL WIRES

Solved!
Go to solution

My project is attached. Thanks

0 Kudos
Message 21 of 27
(598 Views)

I give up!  There is no working LabVIEW program to examine in the file you attached.  I cannot provide any more help.

 

Bob Schor

0 Kudos
Message 22 of 27
(579 Views)

I attached a .zip file which must be uncompressed with winrar. Inside just open PROJECT.lvprj thats all. I have Labview 2017. 😞

0 Kudos
Message 23 of 27
(576 Views)

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, .....

0 Kudos
Message 24 of 27
(565 Views)

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 🙂

0 Kudos
Message 25 of 27
(556 Views)

@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.

0 Kudos
Message 26 of 27
(543 Views)

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.

0 Kudos
Message 27 of 27
(518 Views)