02-08-2012 07:37 AM - edited 02-08-2012 07:38 AM
I have a problem, I wish to programmed in LABVIEW but not how to do it I can explain to you if yoy can help me.
I have 6 inputs, according to the configuration of these entries would show certain images in the LABVIEW, an example:
I have A B C D E F as inputs,
- If A and D are 1 Figure 1 show,
- If A and F are 1 Picture 2 show,
- If B and C are 1 Picture 3 show,
- If A and E are 1 show Figure 4.
The values of A B C D E F come from a PLC. and I'm keeping this data in a Num Ind. (numerical indicator) in LABVIEW.
Can you help me?
Thank you!-
02-08-2012 08:00 AM
Do you have 4 different picture indicators?
If you have singla picture indicator what should happen if the other probablity comes?.
Explain little more so that you would get a better solution.
02-08-2012 08:12 AM
Yes I have 4 diferent image to show.
It could be 4 diferente pictore indicators or a single one, It depends of the solution that you can give me.
02-08-2012 08:52 AM
In the RING and ENUM palette, there is a thing called the PICT RING.
I use one of those to display status: 0 = normal = Company logo, 1 = warning = pict of sign: "Levels Exceeded", 2 = danger = pict of sign: "Danger", 3 = emergency = another pict.
Convert your boolean inputs to a number and feed that number to one of these and you're done.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-08-2012 08:56 AM
And, Convert my boolean inputs to a number??
02-08-2012 09:04 AM
Sorry, I misread your original post. The "and" made me think of booleans.
- If A and D are 1 Figure 1 show,
- If A and F are 1 Picture 2 show,
- If B and C are 1 Picture 3 show,
- If A and E are 1 show Figure 4.
Do you mean:
if (A = 1) and (D = 1)
show Figure 1
if (A = 1) and (F = 1)
show Figure 2
etc?
If that's what you mean, then writing it down as I did should show you the way to go.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-08-2012 09:18 AM
Yes, That is exactly what I want, But where can I write it? what windows or where? And if I put "show picture" where will appear the image?
02-08-2012 09:22 AM
I don't understand your question. The picture appears wherever you place the PICT RING indicator on your panel.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-08-2012 09:33 AM
Where can I put the code as you written? Where Can I program that Code? in the pict ring? or Where?? Could you make a VI proyect to me for undertand the solution??
5 input ( A B C D E)
- If A && D == 1
show Figure1
- If A && F == 1
show Picture2
- If B && C == 1
show Picture3
- If A && E == 1
show Figure 4.
? Please??
02-08-2012 09:56 AM
Your code is indicative of the nonsense that the C language forces you into - "&&" means treat this as a boolean, but "1" is an integer.
LabVIEW has distinct types: a BOOLEAN is true/false, and an INTEGER is a number.
The first rule of moving from C (Pascal, Fortran, etc) to LabVIEW is "forget all the crap that you used to have to do".
Here is a VI that does something like what you want.
You didn't cover all possible combinations, neither does this VI.
But you can diddle the switches and get different pictures.
Blog for (mostly LabVIEW) programmers: Tips And Tricks