LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronising the functions of booleans by their naming

Solved!
Go to solution

Thanks Florian,

 

I am new to LabView, and the reason I want to do that is because Iam working with an automation system that operates valves on a microfluidic tube. The system uses LEDs or booleans as place values for the valves and they are stand alone LEDs. I want to be able to have groups of the booleans synched without putting them into a traditional array because I want to be able to drag and drop the booleans on the chip created with chanels on the automated system. This is a small task I was asked to work on outside of the main LabView software that already existed and I need it to work with standalone booleans. 

 

Could you perhaps help me by providing me with ways to do that, and functions to use from the functions palette and so on. I have been having some trouble with this for a while now.

 

Thanks again

0 Kudos
Message 11 of 28
(858 Views)

I must admit I don't understand the part about "drag and drop on the chip", thus I still don't see why you shouldn't use an array.

Provided the Booleans may not be inside an array for what you want to achieve you could still hold a copy of their values in an array. That would make it easier to manipulate the data.

 

Below is code that does what I posted as a possible solution earlier. Please learn what you can of it - but don't use the codes as is!

It is full of hazards and not a good way to tackle your problem!

That said it shows how you could do stuff based on the names of elements if you really wanted to. I'm sure there is another, better way for you to go though.

 

Switch by name.png

 

hm... that came out wrong.

Don't snippets work with event structures? Or is it because I didn't save the vi?

The case shown shoul monitor value change for the four Booleans.

0 Kudos
Message 12 of 28
(830 Views)

Thanks Florian,

 

I'll definitely see what I can learn from the code you provided. Would it be fine if I had a separate VI with the booleans, and then I used the Oath to Global trick. Everything will be kept running so when I change anything on one either VI everything else changes. Also does the VI you've created work even with the broken arrows, or do I have to find out what could be done with them to get them to become fixed. I will mostly analyse your code to see why it works if it does and which things could be used differently to make it work better. You have been really really helpful though, and I will send any progress I make. 

 

I also apologise for the fuzzy explanation as to why I want the code that has this particular functionality.

 

Sincerely,

 

Tebello

0 Kudos
Message 13 of 28
(822 Views)

You're welcome,

 

I really don't know how the broken arrow came to be.

As stated in the edit to my post above: The event case should monitor "value change" of the 4 Booleans - that should unbreak the code.

 

Regards

Florian

0 Kudos
Message 14 of 28
(819 Views)

@tebelloq wrote:

Thanks Florian,

 

I am new to LabView, and the reason I want to do that is because Iam working with an automation system that operates valves on a microfluidic tube. The system uses LEDs or booleans as place values for the valves and they are stand alone LEDs. I want to be able to have groups of the booleans synched without putting them into a traditional array because I want to be able to drag and drop the booleans on the chip created with chanels on the automated system. This is a small task I was asked to work on outside of the main LabView software that already existed and I need it to work with standalone booleans. 

 

Could you perhaps help me by providing me with ways to do that, and functions to use from the functions palette and so on. I have been having some trouble with this for a while now.

 

Thanks again


Hmm, you'll have to describe better what your goal is, i dont get this at all.

Anyway, dont confuse implementation with GUI, you can have a bunch of free booleans on the GUI, but merge them to an array in the code to easier handle things like this. It'd be even easier if you group booleans in clusters, e.g. all your bool1-X's.

With a cluster you can arrange the booleans as you see fit, yet in the code convert to an array and easily modify, and also easily write back all of the array (converted to cluster) to update all.

 

Use the best tool for the job, and i doubt 20-50 free booleans are the right tool.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 15 of 28
(810 Views)

Dear Florian,

 

I was wondering what the reference you fed into the first part was? Was it the same same VI (I assuem diese VI means this VI)

 

If so Could I create a reference that is whatever VI I am working on?

0 Kudos
Message 16 of 28
(796 Views)

Oh right,

the text in the property nodes changes to your language when you import the snippet - but the labels don't.

Yes "Dieses VI" means this vi, and yes you may use the reference to another vi for the property node.

BUT if the controls you want to sync are not in the vi your event structure is in you'll have to use dynamic event registration to make it work, refer to the help and also see here:

http://forums.ni.com/t5/LabVIEW/Nugget-of-the-week-Dynamic-event-registration/m-p/508407/highlight/t...

 

It's a good thing to learn about all this. I still don't think this is the way you should handle things for this issue. And there's other stuff to learn before jumping into that. Try using the simplest, cleanest way to do it. The monstrous code I provided could bite you in the end (probably will).

Use an array to manipulate the data, or a cluster like Yamaeda said if your only quarrel with an array is that you can't move its elements freely on the FP.

 

Regards Florian

0 Kudos
Message 17 of 28
(788 Views)

Since the snippet is kind of screwed up: Here's a fixed version.

0 Kudos
Message 18 of 28
(769 Views)

Thank you very much,

 

The version you have posted is the 12.0 version and the PC I am using has the 11.0.1 version. Is there a way to save it such that the older version of labview can read it?

 

Thank you very much for the responses to some of my often silly questions.

 

 

0 Kudos
Message 19 of 28
(762 Views)
Solution
Accepted by topic author tebelloq
0 Kudos
Message 20 of 28
(759 Views)