Distributed Control & Automation Framework (DCAF)

cancel
Showing results for 
Search instead for 
Did you mean: 

Data communication between DCAF modules and external code best practice

Hi,

 

Forgive me if this is an obvious question, I have been through the developers guide, posts and other documentation but I want to get this right and I'm running out of time.

 

I'm creating a data interface for a product which includes handling of high speed Labview specific data as well as standard protocols such as Modbus, OPC UA and possibly others in the future, eg, EthernetIP. I'm really using DCAF as a configuration tool to allow mapping of application specific data to DCAF modules. 

 

From what I understand CVT is the recommended way to transfer data to DCAF, is this correct? As I understand CVT is based on functional globals, but this seems to require a lot of effort to create the tags, although mention is made of editing CVT tags externally I have not found a tool to do this. What I have done is create my own FG which passes data to custom DCAF modules and which write it to tags. This data is passed into the DCAF Host Main vi via a queue as shown below. 

Does this make sense?

 

Any comment would be greatly appreciated

 

Thanks,

Mike

 

Host Main.viHost Main.viCustom Module  User InputCustom Module User Input

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

Hi Mike

DCAF has a UI Reference Configuration to update controls on a VI by label. (Note labels must be unique).

For my application I had a splash screen which invoked the host main.vi with the paths etc it needed. 

On the host main.vi diagram I had a subVI that was the main UI for the program.

I then loaded the main UI into the UI Reference configuration. 

Hope this makes sense.

Nick

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

Depends a bit on how well defined that interface is and how large it's going to get.

 

If it's likely to change or become very large, then there's an alternative way with a dynamic module and passing a tag bus data table through the fgv that saves on doing individual writes for each element and copying between two clusters. 

 

Matt

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

Hi MichaelWestwood, as NickNZ and Matt_Diesel mentioned it depends on what data you are sending and what you need to do. In general we recommend CVT as its easy to use if you have just a couple of tags running outside of DCAF, when you have the tags there they are created but yes on your other part of the program you still need to know the names. 

If you know how may tags are being published and don't need to add them your option of a static module with a FGV can work, you can also use queues or in general any communication mechanism in LabVIEW, I have seen people even use AMC inside of a module. 

You can get an idea of how to use queues in the E2E module. 

If you need to communicate with other languages there is also the shared memory module, and as Matt mentioned if its just to update a UI the UI Ref module can be really useful. 

Best Regards

 

 

Benjamin C
Principal Systems Engineer // CLA // CLED
0 Kudos
Message 4 of 7
(6,310 Views)

Thank you all for your help!

 

This is effectively the front end for an industrial measurement system ( https://www.yellotec.com/products/conveyor-belt-monitoring/beltwatch-online/), although we are designing it to be non-specific so it can be used on other products of ours. All the necessary data exists in clusters and the structure of these would only change when the code is changed, so it would be very elegant if it was possible to create tags from the cluster typedefs (with the same names as the cluster elements) and update the tags from the clusters outside DCAF.

 

Forgive my ignorance, I haven't had time to look into tagbus and CVT properly would one of these be the answer?  

 

Mike

0 Kudos
Message 5 of 7
(6,301 Views)

TagBus and CVT don't support clusters, they support the individual tags for your cluster. To some extent tag bus is CVT on a wire so many concepts are the same on both.

There are ways to create programmatic tags, you could look into how the UI module is working, that one allows you to write directly to controls and for its configuration you point it to a VI and in gets the information, so you could do something similar to a cluster.

Here is more information  on CVT:

https://forums.ni.com/t5/Reference-Design-Content/LabVIEW-Current-Value-Table-CVT-Library/ta-p/35142...

This presentation also has a little bit on TagBus:

https://github.com/LabVIEW-DCAF/Documentation/blob/master/Trunk/Presentations/C_DCAF%20Under%20the%2...

 

Best Regards

 

 

Benjamin C
Principal Systems Engineer // CLA // CLED
0 Kudos
Message 6 of 7
(6,239 Views)

I must concur that passing data with CVT does not scale well. The last time I tried using the UI ref module the UI could not have any kind of while loop in it, which is not great if you have other UI functions you need to handle with an event structure. I do kind of like the idea mentioned of creating your own dynamic module that operates on an FGV that exposes a cluster for you.

 

Handling on all the tags individually can really be a pain when you have hundreds. It would be cool to be able to group tags and be able to handle them like that within the DCAF editor. Although that has a strong whiff of the "inner platform effect" to me-- not sure what the right answer is

 

That and the lack of events withing the engine is the main other thing that bugs me about DCAF. I really want to be able to trigger state transitions within modules based on commands

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