FOUNDATION Fieldbus

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-FBUS cannot create controls/indicators for some inputs/outputs

I am using the NI-FBUS VIs with NI USB-8486 and I want to encapsulate some inside of sub VIs, but I cannot create controls or indicators for "link in", "link out", "device in", "device out", "VFD in", "VFD out", "block in", and "block out".  When I right click on the connector/pin and select "Create" the options "Constant", "Control", and "Indicator" are greyed out.  If I want to use the Fieldbus VIs inside of a sub VI there is now way to pass in the necessary data.   What is going on?  Surely it can't be intended that NI-FBUS only be used inside a single large VI.

 

To get around this I have tried to encapsulate more VIs into the sub VI.  Orignally I had intended to do the following inside the sub VI:

1) FF Open Block By Ordinal.vi

2) FF Read Block Object By Name.vi (There is a case structure that optionally selects FF Write Block Object By Name.vi)

 

Now I have done the following (in order):

1) FF Open Link.vi

2) FF Browse Devices.vi

3) FF Open Device By ID.vi

4) FF Open VFD.vi

5) FF Open Block By Ordinal.vi

6) FF Read Block Object By Name.vi (There is a case structure that optionally selects FF Write Block Object By Name.vi)

7) FF Close Block.vi

😎 FF Close VFD.vi

9) FF Close Device.vi

10) FF Close Link.vi

 

This approach works, but I am looking in Windows Task Manager and noticing that Handles (under the Performance Tab) increase rapidly as my test program runs.  (In this case I put the above sub VI in a while loop)

 

Is there an explanation for this?  Am I doing something wrong?  I have uploaded my VIs for your consideration.

0 Kudos
Message 1 of 2
(7,554 Views)

Hi NHigbee,

 

I guess there are two questions from you:

 

Q1. Why can't one create constant/control/indicator for the refnum terminals of FBUS VIs?

A1: This may be something we need to fix.

But on the other hand, for creating subVI's, it should be fairly easy to do - first select which VIs you want to make a SubVI of, and then go to menu Edit>>Create SubVI. This will automatically substitue your selection with a SubVI.

Can this method solve your problem as a workaround?

 

Q2: Why does your VI handlers increase?

A2: I ran you code FF Test.vi and as you instructed I observed that the handles of CPU did increase a bit but it was neither dramatic nor rapidly - it was stable.

The parameter I wrote and read was TEST_RW.VALUE_8 in the resource block. 

In the while loop, open and close of each layer are repeated and there's no timer.

You may improve the VI by losing the open and close part and make them something like initilization and optional destruction out of the while loop. Yes, only if you can pass the refnum terminals. I think you can achieve it with my answer in A1. 

 

Message 2 of 2
(7,547 Views)