LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

automation

Can any one pls help me out Iam trying to automate a process.
 
My spread sheet has 2-cloumns channnel and type. Type is classified in to 2-types a) Tx and b) Rx.Based on the information under "type" tab in the spread sheet a GUI should be created.(These channels are used for CAN communication).Each Rx channel should be tied up with a Meter so that when a channel with some value is received that value should be displayed on the meter.

Similarly each Tx channel should be tied up with a knob so that if knob is set to some value that value can be transmitted.

In brief to say if the spread sheet channel's  tab has 6-Tx and 5-Rx Channels then a front panel with 6 knobs and 5 Meter's should be created automatically.(But the no of channels are not known it can be varied for each test)

        I know how to bring the data from the spread sheet and store in to arrays but i dont know the remaining process Can any one pls pls help me out.Iam attaching my vi and spread sheet.
 
 
Thank you,
 
Shanth. 
Download All
0 Kudos
Message 1 of 8
(3,358 Views)

There is no way you can "create" individual controls or indicators on a front panel programmatically.  (If you could, how would you instruct LabVIEW where to wire the data?)  What you can do is create an array of knobs and an array of meters.  Then you can programmatically define how many knobs and meters are active, and even how many show up at once on the front panel.

 

By using Index Array or Replace Array subset, you will be able to get or set the value of a particular element of the knob or meter arrays.

0 Kudos
Message 2 of 8
(3,354 Views)

Hello Ravens,

 

                    Thanxs for your reply. Ravens can you pls say the procedure how to create an array of knobs and array of meters and programmatically to define how many knobs and meters are active. Because Iam finding difficulty to classify the channels  in to Rx type and Tx type and assign a knob or meter to them.

 

Thank you,

 

Shanth. 

0 Kudos
Message 3 of 8
(3,350 Views)

See attached.

 

Since I don't have your Excel library VI's, I just turned what would have come out of Excel into an Array constant.

0 Kudos
Message 4 of 8
(3,335 Views)

Raevns, 

 

             If i want to connect the o/p of the Rx channel's to Meter's in order to display its value where should i do this in the same way for knob if i want to set the knob at some point and connect it to channel how should i do this.

 

            For example if we take the first row  Voltage -> Tx a knob is assigned to this right. If i set this knob to some value of 24V the output should be connected to a channel. How should I assign the knob to my channel

 

            And  if we take Current ->Rx if Iam reading this as 10 amps how should i connect to the meter and specify that this particular meter is for current and the other one is for speed the next is for Air pressure.

  

Thank you,

Shanth. 

             

0 Kudos
Message 5 of 8
(3,325 Views)
Ravens,

       I made a change to the code you gave me that the data under 3rd column will decide wether a GUI should be displayed or not. If yes then create either a Knob or meter based on Tx or Rx. I was able to do this.

       Can you pls help me, now i want to set the scale, maximum value of knob and meter based on 4th column information. And the value of knob(i.e to transmit) based on 5th column information.

I tried to set the scale by creating a propert node and seclecting range-> maximum/minimum but its creating the same scale for each and every knob.
Can u pls help me. 
 
Thank you
 
Shanth. 
0 Kudos
Message 6 of 8
(3,296 Views)

You are not going to be able to set different scales for each knob.  That is because arrays consist of common elements where all properties are in common except for the value of the element.  The Min/Max range is one of those properties.

 

There are some possibilities, but they require more complicated structures.  One is to use a cluster.  But the problem with a cluster is that you can't programmatically control how many elements you have in that cluster.  Though you could predefine a cluster that has more than enough copies of controls then you think you'll need.  Then you can set the properties of each element of the cluster individually including whether the element is shown or not.  (You create a cluster of 10 knobs.  But if you only need 5 in an instance, then you hide the other 5.)

 

You could create an array of clusters.  Each cluster contains one instance of a knob.  Then you could programmatically get to an element of the cluster array.  Go into that cluster and set the properties of the knob which is an element of it.  This is a much more complicated hierarchy.  I don't have a good example of exactly how to do that.  But if you search the forums, I think you'll find examples of where it has been done before.

 

When working with arrays, if you need to get the value of a particular element of the array, then you use the index array function.  If you need to change the value of a particular element of an array (like an indicator meter) then use the Replace Array Subset function.  Maintain the current status of the arrays from iteration to iteration of your while loops using shift registers.

Message Edited by Ravens Fan on 07-15-2009 11:28 PM
0 Kudos
Message 7 of 8
(3,289 Views)

Ravens,

 

           Can you pls  help me out with a code reading and writing  the values to the knobs and meters.

 

Thank you,

 

Shanth. 

0 Kudos
Message 8 of 8
(3,286 Views)