LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically modify scan engine scaling

I need to be able to programmatically adjust the scaling factors for my cRIO analog channel.  I manage all
my I/O from an external spreadsheet that gets compiled and ftp'd to 9 cRIO targets.  Each cRIO will have different scaling factors.  I understand that this is a feature that will be forthcoming but I need to be able to do this within the next 2 months.  I already have in place a secondary scan engine of my own design that replicates all the I/O and includes such niceties as scaling, filtering,  zero offset and deadband updating.  Recently I noticed a file on the cRIO called 'variables.xml' which quite clearly contains all of the I/O variable properties.  I am planning on writing a utility vi that can modify this xml file.  I believe I would have to call this vi from my cRIO code and then reboot to have it redigested into the LOGOS? server or scan engine.  I understand that the development engineers loath to support this type of activity and I also would not want this to be permanantly in my code, but only as a short term solution until the proper API is released.  If anyone has a better idea I would love to hear about it.
0 Kudos
Message 1 of 5
(3,174 Views)

sachsm,

 

While I definitely don't promote doing what you suggested, I tried it out and it looks like it should theoretically work with a reboot.  I only did this with a straight VI ran from LabVIEW.  The xml file is generated when the scan engine variables are first deployed.  This file is updated on an input-by-input basis based on what was edited in the project explorer.  If the xml file is edited, then the device rebooted (but the project not changed) and you run the VI, the 'updated' scaling will be present.  Once you edit the particular IO in the project then it will override the manual edit.  When these are changed the scaling changes go into effect immediately and the device doesn't need to be rebooted.  Good idea, indeed, not sure if or what the implications may be with this though.  Definitely try at your own risk for this one.

Regards,

Jared Boothe
Staff Hardware Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,134 Views)

Hey Mike,

 

Here is the NI Scan Engine Advanced I/O Access API:

http://zone.ni.com/devzone/cda/tut/p/id/8071

 

Note: I/O forcing, scaling, and I/O aliases are not supported with this API

 

Kurt 

0 Kudos
Message 3 of 5
(3,080 Views)

When you say that I/O forcing is not supported do you mean that channels written to using the advanced I/O access api will overwrite any forcing

that is in place?

0 Kudos
Message 4 of 5
(3,075 Views)
Yes. Reads will read the unforced or real-world value and writes will over write the forced value.
0 Kudos
Message 5 of 5
(3,068 Views)