From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Create XY Channel associated to an existing time channel

Solved!
Go to solution

Hi,

 

Suppose that in my Data Portal there is a group (e.g. "Group Test") containing a time channel ("Group Test/time") and several XY Channels ("Group Test/Var00", "Group Test/Var01", etc.)

 

I would like to create a new XY Channel  associated to "Group Test/time". It should be added to the same Group. This new Channel of course hs the same length as all the other channels of that group.

 

I am able to create a channel, but I cannot associate to the time reference

# Create Channel. OK
dd.ArrayToChannels(outX, ['Group Test/calcChan']) 

# Associate calculated channel with X-Reference. KO
dd.Data.Root.ChannelGroups('Group Test').Channels('calcChan').XRelation = 'time'

Running the script above, I get the error message "AttributeError: Property '<unknown>.XRelation' can not be set."

 

Is there a way to do it? Many thanks

 

Annotation 2021-12-02 142742.jpg

0 Kudos
Message 1 of 2
(952 Views)
Solution
Accepted by topic author panta1978

I figured it out! In case someone else will need it, that's how I did it.

 

# Create Channel. OK
dd.ArrayToChannels(outX, ['Group Test/calcChan']) 

# Associate calculated channel with X-Reference. KO
dd.Data.Root.ChannelGroups('Group Test').Channels('calcChan').xRelation = dd.Data.Root.ChannelGroups('Group Test').Channels('time')

 

Basically I shouldn't associate a text string, but a channel.

0 Kudos
Message 2 of 2
(913 Views)