LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combined Examples LINX with Uno

Being totally new to LabView and the Arduno Uno, so far, after uploading the LINX firmware to the Uno, I've been able to successfully combine the LINX example code for Digital Read, Digital Write and Analog Read into the following BD:

Capture.PNG

 

While not a major feat, it runs without errors - at about 50hz.

 

I would like to increase the I/O to read all 6 Port C AIs, write all 6 Port B DOs and read all 8 Port D DIs at a decent scan rate.  My questions - where would I find information on how to change these combined examples to specify fixed port channels, increase the number of channels, and improve the scan rate.  At this point, I'm not sure of what the forum and/or search criteria should be.

 

In the end, the goal is to have an external controller send process control signals and receive process feedback through the Uno which exchanges the digital and analog signals with the yet to be written Labview process simulation.

 

Thanks.

0 Kudos
Message 1 of 3
(217 Views)

@Jason1029 wrote:

Being totally new to LabView and the Arduno Uno, so far, after uploading the LINX firmware to the Uno, I've been able to successfully combine the LINX example code for Digital Read, Digital Write and Analog Read into the following BD:

Capture.PNG

 

While not a major feat, it runs without errors - at about 50hz.

 

I would like to increase the I/O to read all 6 Port C AIs, write all 6 Port B DOs and read all 8 Port D DIs at a decent scan rate.  My questions - where would I find information on how to change these combined examples to specify fixed port channels, increase the number of channels, and improve the scan rate.  At this point, I'm not sure of what the forum and/or search criteria should be.

 

In the end, the goal is to have an external controller send process control signals and receive process feedback through the Uno which exchanges the digital and analog signals with the yet to be written Labview process simulation.

 

Thanks.


The way this communication works is a simple command-response scheme, each of these VIs needs to wait for any of the other VIs to finish its command-response procedure before it can do its own thing. That means that your network latency is in fact the limiting factor (and the rate would go down even a lot more if your device is not directly connected to your computer but goes through some routers and/or even worse, internet gateways).

 

The only way to improve this would be to add a Custom Command to your firmware on the Uno that does all the collection of the data for any and all channels that you are interested in and returns them in a single response to the requester. This is not rocket science but will require you to customize the firmware on your Uno and compile it yourself and install it, and to agree on a request-response format for your Custom Command.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 3
(186 Views)

Rolf, thanks for your reply.  Seeing that the LINX firmware for the Uno R3 could handle all of the various Labview example code files, I was hopeful that combining and expanding the features I was interested in would fill the bill.

 

Since that's not going to work, I went looking and found the LINX code here to see if anything could be gleaned from it: https://github.com/LVMakerHub/LINX/blob/main/LabVIEW/vi.lib/MakerHub/LINX/Firmware/Source/core/examp...

Doesn't look like it, at least to me, at the moment.

 

Moving on, my searches have come across something called 'port manipulation' for the Uno.  From what I've seen so far, it sounds like the preferred approach - exchanging bit mapped bytes of port information over the USB to minimize communication load.  If I take that approach, what's a good reference for how to configure Labview to talk to a Uno programmed in that way - or is there another preferred approach?

 

Came across this article: https://pdxscholar.library.pdx.edu/cgi/viewcontent.cgi?article=1322&context=phy_fac

Which references this document in the references: NI, Writing Bits to the Serial Port Instead of Writing ASCII Strings,
http://digital.ni.com/public.nsf/websearch/575CDC2EEA251F3086257062007645CA?OpenDocument

 

But the http (no s) link is broken and after a search, I'm not finding it.

 

Thoughts?

Jason

0 Kudos
Message 3 of 3
(162 Views)