FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I dynamically detect new modules in cFP-2200?

Solved!
Go to solution

Hi,

 

I'm working on a project which monitors voltage using cFP-2200 with any number of cFP-AI-102 modules installed. Each cFP-AI-102 analog channel will correspond to its own state machine which reports information to a central database.

 

I want to create something that does not need to know how many cFP-AI-102s are installed ahead of time. At start up, my software should be able to detect all cFP-AI-102s and dynamically create the state machines for each channel, whether I have 1 AI-102 (8 analog channels to monitor) or the maximum of 8 installed (64 channels to monitor).

 

Right now, I can only figure out how to program for channels which are currently available by connecting to the module in its current state and clicking/dragging the analog channels from the project window. Is it possible to program for channels that aren't there but could be later? The application of this is to deploy the module to the field and have the option to add or remove AI-102s without changing the installed software.

0 Kudos
Message 1 of 7
(6,963 Views)

kgolden,

 

When you deploy .IAK file to a cFP target, information about modules that are configured is stored in a file called 'fpbank.ini'.  This file is located in 'ni-rt/system/' directory on the cFP.  You should be able to use the 'config file' vi's included with LV to get this module info at runtime.

0 Kudos
Message 2 of 7
(6,955 Views)

Hello Wayne,

 

I will certainly explore that further!

 

One thing I have discovered (being realtively new to Labview) is that I can change field point IO constant to a different path. I had my AI-102 module installed at the following path:

 

FieldPoint\cFP-2200-prototypeModule\cFP-AI-102 @1\Channel 0

 

I created a second constant and changed the path to:

 

FieldPoint\cFP-2200-prototypeModule\cFP-AI-102 @2\Channel 0

 

(@2 being a place where I did not have a module installed.)

 

I then simply caught the error thrown to do nothing if the module didn't exist there. To test, I wired up an indicator to display the voltage if it was there and a message stating the module didn't exist if it was not. It worked.

 

I then switched the AI-102 module I have to the @2 location and tried it again. I ended up having to restart labview and re-add the entire FP module to the project but it worked at that time displaying the error for @1 and voltage for @2.

 

So my solution right now is to simply assume  all modules are present and if they are not, to "do nothing" on the error thrown when trying to read from them.

 

Reading from the ini file at startup may be a better solution though. Since I need to build a module where AI-102s can be added or removed followed by a restart of the module, will this ini file automatically get updated to reflect whatever configuration is there as soon as the module is turned on?

 

 

 

 

0 Kudos
Message 3 of 7
(6,944 Views)

kgolden,

 

After reading you last post and re-reading your initial post, I would say that assuming that all modules are present is the way to go.  Create a project with the cFP target fully populated with AI-102's.  This will create a .IAK file that can be deployed from the project and the .ini file will be created on the cFP showing all the modules are installed.  You should then be able to create a vi that can test to see if and where modules are installed when the cFP starts up.  You can then dynamically create as many copies of your code as you have modules.

 

Once you get the first one of these targets up and running, you should be able to use the RT Target Replication tools to make copies. 

0 Kudos
Message 4 of 7
(6,932 Views)

My boss is going to give me two AI-102 modules to play with at once since they are kind of expensive. I won't have all 8 until much later in this project.

 

Are you saying the ini file will only be properly created if I have the max number of AI-102s? Is it possible to manually edit the file instead?

0 Kudos
Message 5 of 7
(6,925 Views)
Solution
Accepted by topic author kgolden

kgolden,

 

Are you saying the ini file will only be properly created if I have the max number of AI-102s?  Yes, you need to have 8 AI-102's in your project under the cFP target.  That forces them to be included in the .IAK file and in turn causes them to be defined in the .ini.  I think you can use the Project Explorer to add modules to the cFP even if they don't physically exist.

 

Is it possible to manually edit the file instead?  I think it is possible to manually edit the .ini.  I'm sure that NI won't support manually editing this.  The question would be are there other .ini files on the cFP that include references to the installed I/O modules?

0 Kudos
Message 6 of 7
(6,920 Views)

Wayne,

 

Thank you! It appears I can add modules that don't yet exist. I didn't even know to try until you mentioned it. This will really help me get this off the ground without having to ask my boss to spend more money prior to delivery of a proof of concept.

 

Thanks a lot!

0 Kudos
Message 7 of 7
(6,918 Views)