Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a digital output be use as part of an edge separation measurment

Labview 8.0, PXI-6229

I am asserting a rising edge on PFI8 used as a digital output, and I  need to measure the time between that edge and a second rising edge on PFI1 used as a digital input.
The two edge separation vi looks promising if I can add the internal routing.

Can PFI8 serve as an output and also be routed internally to the counter? How?

I have added a property node with CI.twoedgesep.first.term,CI.twoedgesep.second.term in an attempt to create the proper routes, but it is not working.




0 Kudos
Message 1 of 15
(5,374 Views)
Hello tadk,

If this is not working for you, it is probably just a timing issue.  The method you have described is the correct way of setting up this task.  I'm assuming that you are getting a timeout error (-200474).  You have to make sure that you are generating the rising (or falling) edge on PFI8 after the DAQmx Read for the two-signal edge-separation task has started but before it times out. 

I am attaching a small program that I wrote which shows how you could measure the time between two rising edges, both generated internally.  I have tested this example on my PCI-6251, and it works, so hopefully it will help you out.

Best regards,
0 Kudos
Message 2 of 15
(5,363 Views)
Great, it looks like what I need.
It is hard to tell what is being routed from the available  docs. Sometimes an identifier like 'PFI8' means the physical external pin, sometimes it means the internal node at that pin and sometimes it  seems to mean a route that connects to that internal node. Are there any diagrams that depict the internal switches/muxes and tell which subvi controls them?
0 Kudos
Message 3 of 15
(5,355 Views)
Will the two routes created by the property node be removed automatically at the task end or do I need a "tristate output" for each one?
0 Kudos
Message 4 of 15
(5,355 Views)
Hello tadk,

There are no permanent routes that are being made on the board, so you do not need to do anything special to clear them.  These settings are local to the task in the program and will be cleared whenever you clear the task. 

Also, to provide some clarification on your previous comment, the PFI lines are simply general-purpose timing and triggering lines.  Each pin on your board has a physical pin number and then a terminal name.  The physical pin numbers are there so that you can make the proper connections to your terminal blocks.  The terminal names, such as PFI1, describe what functionality that physical pin has on your particular board.

Anytime you see reference to a PFI line, it is referring to the terminal name which describes a particular timing/triggering line.  It is not referring to an actual physical pin (since these can vary by device), or to an internal route.  Of course you can route signals to a particular PFI line, but the PFI name is not referring to that route. 

I hope this clears things up for you a bit.

Best regards,
0 Kudos
Message 5 of 15
(5,348 Views)
The example works for me but only after extensive modification.
The first problem is the error cluster connected to the first sequence frame prevents the port lines from toggling until after the counter timeout.
The second problem is the lines I want to detect edges on are not on the same port. I kept having problems (no output, errors or hard crashes!) with this part so I removed the entire digital task branch and replaced it with a simple flat sequence with the error cluster running thru the entire thing. I statically set the digital pins in the sequence frames and did not use a task. I am sure there is a way to use a single digital task and still control pins from different ports, but I do not see how.
0 Kudos
Message 6 of 15
(5,347 Views)
Hello tadk,

Sorry about the error cluster.  You're absolutely right and I'm not sure how I made that mistake.  I know I tested the code and it worked, so I must have accidentally modified it afterwards. 

As far as using the different ports, your approach works, or you can still do it with one task by modifying the "lines" input to the DAQmx Create Channel VI.  I've attached a new version of my code that shows the proper formatting.

I hope this helps!

Best regards
0 Kudos
Message 7 of 15
(5,336 Views)
OK, but the pins you have chosen are still on the same port and you only have one port control input on the panel. On the digital writes, it shows 16bits of control input, but I would only want to write the two ports. I don't see a way to remove the bits I don't want to modify from this control, and that's why is used a separate digital write vi for every pin I want to modify.
thanks 
0 Kudos
Message 8 of 15
(5,330 Views)
Typos!
"ports" -> "bits"
"is" -> "I"


0 Kudos
Message 9 of 15
(5,329 Views)
Hi tadk,

Sorry again.  I forgot to set the default values on the front panel controls.  I've modified the example again and this time, it only writes to the two lines that you want instead of the entire ports.  I hope this helps!

Best regards,
0 Kudos
Message 10 of 15
(5,326 Views)