From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Project Electrical Wiring Export (cRIO, cDAQ)

Code and Documents

Attachment

At the 2014 UK CLD Summit Developer Jam session, I proposed a problem asking how can you export the physical channel assignments for a CompactRIO project.

 

In our projects we usually rename the C-Series signals to have sensible names according to their function (e.g. Pressure_In, Pressure_Out, Ambient_Temp) and we then need to provide that information to the electrical designers / technicians to do the electrical schematics or wire the thing up. Up until now, we have had to manually generate a spreadsheet with the pin assignments or, if needed quickly, provide screenshots of the LabVIEW project tree.

 

2014-05-13_23-18-41.png

 

The solution was to delve into property nodes of the project to try and find the appropriate items to pull out and get the associated information from the IO signals.

 

Top Level VI

2014-05-13_23-26-10.png

 

cRIO Elemental IO

GetcRIOIOItem.png

 

Result

2014-05-13_23-27-46.png

 

Since the session, I tidied up the code a little to make it into more of an API and introduced a bug in the process - signals get duplicated twice because the get all descendents seems to return items twice (once for the chassis and once for the RT target it seems).

 

I will try to fix the issue when I get a chance unless someone else tries it and beats me to it!

 

This allows the process to be automated and saved in the project folder so we can easily provide it on request!

 

Question for the audience!

One thing that we were looking at as a group and something that Greg was investigating was that you can use MAX and the DAQ assistant to generate pictures/diagrams of the connection diagram for a DAQmx task. Does anyone know how you can export this diagram/picture programmatically? You can save to a HTML report from within MAX but is it possible to do this programmatically and then pull out the pictures?

 

This is the type of diagram we were talking about:

2014-05-13_23-34-00.png

 

 

 

Thanks to the group for attempting my problem and hope you find the results useful! Also thanks to Mike for taking my crazy idea of a developer jam and running with it!

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.