ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino with labview using linx

Hi,

I am using Arduino with labview and burning the program into arduino using makerhub linx. the problem I am facing is the delay in reading the input data from arduino to labview of about 10 seconds. looking forward for possible solutions.

 

Thanks

0 Kudos
Message 1 of 13
(4,974 Views)

Hi kash,

 

the problem I am facing is the delay in reading the input data from arduino to labview of about 10 seconds. looking forward for possible solutions.

I guess the problem is in your software.

You need to debug your software to find and eliminate that problem.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(4,961 Views)

Well without seeing your code all we can say is you are doing it wrong.

 

Beyond that your guess is as good as ours.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 13
(4,951 Views)

My guess is you are closing and reopening the reference between each read.  This causes lots of extra delays and a better method is to open once, read many times in a loop, then close once.  Just a guess though and as others said posting the code would help with that.

0 Kudos
Message 4 of 13
(4,946 Views)

Sounds like a timeout error to me.

 

But who would know without seeing any code posted.

0 Kudos
Message 5 of 13
(4,933 Views)

Kind of fun to guess without source code 😉

 

But at 10 seconds, it's almost certainly a VISA Read timeout. Add a termchar to the end of your data stream from the Arduino. I can't recall if VISA Read's default timeout is 2 seconds or 10 seconds (and it may vary by device/driver? I'm not sure).

0 Kudos
Message 6 of 13
(4,923 Views)

I am sharing the snapshot of the code. the problem i feel is with linx open serial which is taken time. the reason being, there is a delay in execution of the first sequence.

0 Kudos
Message 7 of 13
(4,909 Views)

i think the delay is due to the initialisation of the linx.  Now the problem is, I am also actuating the actuator via digital write through linx and due to delay in acquisition, the actuator does goes to the extreme position till it start acquiring the data.

0 Kudos
Message 8 of 13
(4,907 Views)

@kashifsherwani wrote:

i think the delay is due to the initialisation of the linx.  


I think you should show us your code so we can actually help you.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 13
(4,897 Views)

hi,

 Please see the attached code. here i am using makerhub linx for the acquisition of data. To enter the sequence, it takes times.

0 Kudos
Message 10 of 13
(4,884 Views)