Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

XNET timestamps in CVI?

XNET defines a type called nxTimestamp_t (in CVI) yet I don't see anything in the API about getting a current timestamp in this format.  If I'd like to measure the interval between two CAN messages, the intuitive way I see to do this is to call a function that would return an nxTimestamp_t, yet there doesn't seem to be one.  Did I miss something?

0 Kudos
Message 1 of 7
(7,635 Views)

If you want to measure the time between to frames you can simply use the timestamp you get when reading the frame.

 

The timestamp you are referring to can be optained from the XNET card using the Read function. This timestamp represents the actual timer value of the card's local timer. You can use this function to see how fast your card drifts.

 

Best regards,

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
0 Kudos
Message 2 of 7
(7,628 Views)
Sure, between two successive reads that would work fine, but what if I want to measure the time between a message write and a message read? There's no nxTimestamp function that'll give me a reference point in nxTimestamp_t units and nxWrite methods don't return a timestamp value either.
0 Kudos
Message 3 of 7
(7,620 Views)

You can set your Write frame to occur at a certain time in the future. Check out #7 of the Incompatible Code section of this DevZone. Notice that you need NI-XNET 1.1 for this capability.

 

Using this method, you can send your frame at a known time, then compare it to the timestamp included with the frame you read.

 

Hope this helps.

 

Regards.

---

Peter Flores
Applications Engineer
0 Kudos
Message 4 of 7
(7,611 Views)
This shows how to do it in LabVIEW.  What I'm asking for is the CVI equivalent.  I can't find any function calls in the API that can generate a timestamp or return the device's current timestamp.  How do I generate an nxTimestamp_t type timestamp in CVI with a date that I specify?
0 Kudos
Message 5 of 7
(7,609 Views)

You can read the current timestamp using nxReadState, check the XNET hardware and Software manual for details.

 

Best Regards,

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
Message 6 of 7
(7,601 Views)

AndreasS wrote:

You can read the current timestamp using nxReadState, check the XNET hardware and Software manual for details.

 

Best Regards,


Ah, perfect, that's what I was looking for, but I couldn't find anything about it when searching for nxTimestamp.  Thanks!

0 Kudos
Message 7 of 7
(7,590 Views)