DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

channel sorting

Hi,

 

I have multiple .csv files that I import into the data portal, I want to be able to write a script that looks for specific channels and puts them into view for comparisons. I want to know how would I assign channels a variable that would sort through whatever file I import and pull those specific channels for comparison.

 

Thank you.

0 Kudos
Message 1 of 20
(4,633 Views)

If I understand what you're trying to do, your best bet is to plot all the plots you'd like, and save that view layout. You'll want to setup your settings to be namebased not group based. This way it will call channels and groups by name not by number. So as long as your CSVs are all named the same, it doesn't matter what order they load into your Data Portal.

0 Kudos
Message 2 of 20
(4,604 Views)

call View.Sheets.RemoveAll

Set Vsheet = view.Sheets.Add("U_FREXG")

 

Set NewArea= Vsheet.ActiveArea

 

NewArea.DisplayObjType = "CurveChart2D"

 

Call NewArea.DisplayObj.Curves2D.Add("[1]/Time","[1]/U_FREXG")

 

 

How do I make it so that Time is constant against a variable [i]/U_FREXG or anyother channel I am looking for? I want to make it automated, so its just plug and play.

 

Thank you.

0 Kudos
Message 3 of 20
(4,586 Views)

Well you need some type of a loop. Are you trying to plot every channel against time? If you can show your file structure it would help.

0 Kudos
Message 4 of 20
(4,572 Views)

Yes, we get csv files that we pull into the data portal and we have to compare several channels in View just  as a quick quality check.They must all be plotted against time.

0 Kudos
Message 5 of 20
(4,569 Views)

Call Area.DisplayObj.Curves2D.Add("[1]/Time","[1]/U_FREXG")

Call Area2.DisplayObj.Curves2D.Add("[1]/Time","[1]/TEO.1")

Call Area.DisplayObj.Curves2D.Add("[1]/Time","[2]/U_FREXG")

Call Area2.DisplayObj.Curves2D.Add("[1]/Time","[2]/TEO.1")

Call Area.DisplayObj.Curves2D.Add("[1]/Time","[3]/U_FREXG")

Call Area2.DisplayObj.Curves2D.Add("[1]/Time","[3]/TEO.1")

 

 

d of calling all these sheets, is there a way to just call ALL time found in the data against ALL of another certain channel?

0 Kudos
Message 6 of 20
(4,529 Views)

Hey,

 

If you want to do this for every group in your Data Portal, you could do this:

 

for each group in Data.Root.ChannelGroups

    Call Area.DisplayObj.Curves2D.Add("[1]"Time",group.Channles("UREXG"))

    Call Area2.DisplayObj.Curves2D.Add("[1]"Time",group.Channles("TEO.1"))

Next

 

if you just wanted to do this for the first three groups, you could do:

 

For i = 1 To 3

    Call Area.DisplayObj.Curves2D.Add("[1]/Time","["&i&"]/U_FREXG")

    Call Area2.DisplayObj.Curves2D.Add("[1]/Time","["&i&"]/TEO.1")
Next

Britton C.
Senior Software Engineer
National Instruments
0 Kudos
Message 7 of 20
(4,501 Views)

The second option worked, the first one gave me this error:Snip.PNG

0 Kudos
Message 8 of 20
(4,484 Views)

Also, thank you.

0 Kudos
Message 9 of 20
(4,483 Views)

Capture.PNG

How can I make it so that I dont have to adjust the number of files I will cycle through?

for i to uberbound does not work.

0 Kudos
Message 10 of 20
(4,374 Views)