Jump to content

Conrol of wires


Recommended Posts

Among other capabilites, I'm looking to move / distribute a selection of wires.

NO :nono: , I do not want to use the "clean up wire" method.

I'll do the processing of what new positions they need to go to, but I can't find a function that will successfully move a wire/section of wire.

Any direction? :question:

Link to comment
Among other capabilites, I'm looking to move / distribute a selection of wires.

Any direction? :question:

4436[/snapback]

Norm,

So, you've got an array of wire refnums, is that correct? And you want to script a way to move them around without changing the actual wiring? I hope I've got the task correct. If so...

A wire refnum has properties for the Terminals[] which it connects. There's always one source and one or more sinks. ( I think I saw somewhere that the source is always the zeroeth element, but I'm not sure.) A wire also has a read-only property, Joints[], which describes an array of clusters of segments and branches. The problem here is that the wire's Joints[] property is read-only.

BUT, if you get references to the Terminals[], and figure out source and sink(s), there's a method on a Terminal refnum for 'Create Described Wire'. I think you can invoke that with your computed array of junctions and segments (how you do all this sounds like quite a chore, good luck :blink: ), and LV should replace the existing wire with the described wire (since redundant wire paths were rendered impossible to produce starting around, I think, LV 6).

Is this what you want to do, or did I miss the point?

Best,

Dave

Link to comment

Norm,

As a follow-up - I played around with this a bit and though my brain is too tired :wacko: to figure out the LV coordinate system at this late hour, I did learn two things:

  • Create Described Wire does not replace the existing wire, I had to invoke Delete on the wire refnum (obtain its terminals first!)
  • it's very easy to create lots of broken wire segments trailing off from your 'good wire' if you don't have a Cartesian clue
  • I can't count

Best,

Dave

Link to comment

Well I'll be brief at this late hour myself.

I was trying to do something very specific so flexibility didn't get in the way of the first few learning steps.

I have a BD in which I had 14 segments of wires selected.

Got the Selection[] and casted those ref's to wires like their class name suggests.

From there I wanted to kabitz w/ their positions to do a control like distribution.

Maybe I just need to dig up the business cards from the LV R&D guys that I got at NI week last year to get the "unofficial" skinny on this

Link to comment
  • 3 months later...
As a follow-up - I played around with this a bit and though my brain is too tired  :wacko: to figure out the LV coordinate system at this late hour...

The attached VI contains these VIs from the XNode llb which could be helpful figuring out the coordinate system:

C:\Program Files\National Instruments\LabVIEW 7.1\vi.lib\Utility\XNodeSupport.llb\XRect16To32.vi

C:\Program Files\National Instruments\LabVIEW 7.1\vi.lib\Utility\XNodeSupport.llb\XRect32To16.vi

C:\Program Files\National Instruments\LabVIEW 7.1\vi.lib\Utility\XNodeSupport.llb\XPoint32To16.vi

C:\Program Files\National Instruments\LabVIEW 7.1\vi.lib\Utility\XNodeSupport.llb\XPoint16To32.vi

Download File:post-987-1123171014.vi

Brian

Link to comment
  • 1 year later...

Has anybody managed to access a wire branch instead the whole wire?

I have a wire that connects one source and several sinks, and I want to delete just one segment, leaving the rest intact. But I can't see how, all methods and properties refer to the whole wire, though this can easily be done manually.

post-1450-1155725912.gif?width=400

I could delete the wire and re-connect the source to the remaining terminals, but dinamically created wires are not really clean and it could lead to new problems :wacko: .

Saludos,

Aitor

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.