07-31-2017 05:48 AM
No, you should have a section for each channel. Here is an example from one of my recent projects.
[AI Channel1] Name=GPIO1 Physical_Channel=DAQ1/ai1 Max_Value=10 Min_Value=0 [AI Channel2] Name=GPIO2 Physical_Channel=DAQ1/ai2 Max_Value=10 Min_Value=0
07-31-2017 08:54 AM
Alright sure no problem, it should look something similar to this with what you had in mind:
I was trying to think of a way of narrowing down the number of blocks used without having to create a sub VI.
There was one other method I came across on the forum which I thought may be simpler, feel free to critique its functionalities in comparison to the other VI.
07-31-2017 11:26 AM
Use a FOR loop for reading each section. It will greatly reduce the amount of wiring you will have to do. And using clusters would also help.
08-01-2017 03:23 AM - edited 08-01-2017 03:23 AM
Are you using that function from OpenG library?
08-01-2017 05:01 AM
No. I have not gotten permission to use OpenG. I just have a VI that gets all of the section names and filters them. This gives me an array of sections that I loop over to make an array of channels (cluster or object).
08-01-2017 11:01 AM - edited 08-01-2017 11:02 AM
Yeah after doing further research I don't want to run into any compatibility issues so I'll stick to generic LabVIEW functions.
I've highlighted the execution for the .ini file and it seems to be delimiting the data as desired.
The only issue I'm experiencing now is connecting the virtual channel. I'm sure it's just a simple function that's required. I've illustrated the block diagram below:
Would I need an array function to achieve a connection? Would appreciate feedback for the best practice approach.
08-01-2017 02:48 PM
1. Do not use the second FOR loop. Just hard code the key names and have all of the Read Key associated with each parameter.
2. Put the Create Virtual Channel inside of the FOR loop.
3. Get in the habit of using shift registers on your FOR loops for references. Bad things happen when you end up with an empty array autoindexing into a FOR loop (the loop will iterate 0 times and all of your output tunnels will have default values, shift registers pass the initial value through).
08-02-2017 10:48 AM
Many Thanks for your hints and tips. I followed your advice and have edited the design.
There's one function of the VI that remains to be attached which is the "Key Names" for the "Get Key Names" VI. I'm not sure what it should be connected to. On my previous VI it was connected to the "Read Key" via Auto Indexing channel using the additional "For Loop". However now that the "For Loop" is removed the "Key Names" output will not connect to the Key input of "Read Key".
08-02-2017 11:08 AM
08-02-2017 03:43 PM
For any beginners looking to use Config Files (.ini) here is a small template to get you started. Many Thanks and full credit to Crossrulz for his advice along the way.
Hopefully it will make its way to "Find Examples" in LabVIEW someday (my personal optimism!).