Example Code

Create EPICS PVs programmatically (requires DSC module)

Code and Documents

Attachment

Since we're new to EPICS, I'd like to share two different ways we've come up with of providing EPICS support for a VI using the new DSC module functions. If you have any suggestions for improvements/additions then please comment.

In the attached project: (requires LV 12)

Method one - "Test vi with internal EPICS launch.vi" - requires the user to create project shared variables manually and bind them to front panel objects. It then creates the EPICS variables bound to these. Although simple, this method still requires the rather tedious process of creating a load of shared variables and then binding them to front panel objects. However, it is compatible with LV RT which is great for providing built-in IOC capability on cRIO/PXI.

Method two - "Top level demo.vi" - does not require a project or any customisation of the subVI. It launches the equivalent "Test vi with external EPICS launch.vi" by creating all the SVs, binding them to FP objects and then creating the EPICS variables. You can also use this on reentrant vis by replacing "Open VI Reference" with the OpenG function "Open VI Clone Reference". Although I found this to be a bit buggy so it's not included.

Unfortunately, due to a limiation of the DSC module this method doesn't work on LV RT. I hope NI will fix this one day...

Also, as yet, the DSC EPICS server doesn't allow you to write to any PV field except VAL. However, we found that this isn't too big a deal, as some higher level client can setup and monitor alarms, etc. and we currently only use LabVIEW at the server-side not client side of SCADA.

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

Contributors