07-01-2011 10:02 AM
I need to replay a CAN trace with high fidelity and rapid-fire sequencing. The PC operating system gets in the way too much to be able to control this tight of timing. It needs to be managed within the real-time target.
Do the table stimulus or the replay stimulus load the data to the RT and then execute from the RT target, or does the Workspace running on the PC stream the data to the RT for execution? Streaming would be subject to PC operating system delays and network transport delays.
Thank you in advance for your assistance.
Solved! Go to Solution.
07-01-2011 10:14 AM
The stimulus table data gets loaded entirely into memory on the RT target and is replayed from there. PC or network delays will have no effect on the replay once it starts.
07-01-2011 10:18 AM
Wonderful. Thanks for the quick reply.
How large of a .CSV table can be loaded? Is it limited by Veristand (Workspace/RT) or by RT RAM?
07-01-2011 11:13 AM
It is limited by the size of the Auxiliary Buffer as specified on the main Stimulus page in System Explorer for your system definition. The default size is 10000. The units of that size is number of doubles.
The following is the calculation to determine how big an auxiliary buffer you will need for a given stimulus table-based replay configuration:
AuxSize = (NumRows) * (NumCols - 1) * 2
You subtract one from the column count because of the timestamp column which doesn't get replayed. You multiply by two because each data column gets paired with a copy of the timestamp column for the XY replay. This calculation only applies for a replay specification that doesn't have any analysis (Expected Value) or faulting columns it. Those are calculated differently.
If you exceed this size aux buffer size accidentally, you will get an error when you try to run the profile.
Hope this helps!
07-01-2011 11:18 AM
What are the size limitations on the Auxiliary Buffer? I have a long trace.
07-01-2011 11:40 AM - edited 07-01-2011 11:43 AM
The size of the aux buffer should only be limited by the RAM on your target. It is just an array of doubles allocated by VeriStand for use in replaying data and other related tasks.
Two features that can help with potentially long traces:
1. The timestamps don't have to be in regular intervals. You could have a timestamp column with 0, 100, 300, 1000, 2100, etc...
2. If you import the table data in the Stimulus Profile Editor tool, you can turn on interpolation on a generator-by-generator basis. This is linear interpolation between points. If that is acceptable, you might be able to reduce the size of your playback file and just rely on interpolation to fill in the gaps.
07-01-2011 03:11 PM
Hmm... The trace I'm working with right now is broad as well as very deep. 25 different CAN IDs, 100,000 total messages deep.
¿Even a channel that changes value only once in the trace must be defined for all rows in the table? Ouch. Some of the channels are sent every 10ms whether they change or not, others are sent rarely, change rarely.
For the purpose of this test, Were I able to configure the channels to each be all 8 bytes of data (i.e. only a single channel per CAN_ID) the AuxBuffer would be 100,000 * (25-1) *2 = 4,800,000.
I presume the table defines the VALUES of the channels in time and that the timing of the associated CAN messages depend on the configuration of the message in Explorer as periodic vs send on value change.
This is a trace from the field with all it's variable timing.
The abstraction of the databytes into meaningful "channels" has real value in many ways, but the abstraction from the message timing is a complicating factor in this case.
Is there a simple non-abstracted CAN playback capability within Veristand system that runs in the RT?
07-01-2011 03:45 PM
There are a couple of other options I can think:
1. Split your data file that you import into the Stimulus Profile Editor into multiple files and import them individually into a single stimulus profile. This will allow you to have much smaller row counts for CAN channels that don't change often. There is no restriction in a stimulus profile that all the playback generators have to be configured with the same timestamps or row numbers. That restriction only applies to each individual files that's imported. The downside is now you have multiple files to manage instead of just one.
2. If you are using NI-XNET CAN support in NI VeriStand, there is a data replay option you can configure in System Explorer. Unfortunately, this must be configured statically ahead of time, and the only file format supported in 2010 is the ncl file format. You can log this file format from NI VeriStand.
3. There is a Streaming File Replay custom device that streams the data from disk rather than requiring the entire data set to be in memory at once. The streaming is done on the RT target as a buffered process. It will not be affected by PC or network delays, but it's possible to lose data if the CPU usage gets too high. The downside here is that you have to have your file in a TDMS format and you have to configure the file replay directly in the System Definition ahead of time.
07-01-2011 04:04 PM
I am using NI-XNET CAN support in NI VeriStand (currently VS2009). I don't find anything searching "XNET replay" other than this thread. Can you provide a link?
Is ncl a text based format? I can change format with AWK if it is text. No hits on "ncl format" either. Can you provide a link?
07-01-2011 07:41 PM
Sorry, I should have asked this first. The suggestions I gave were all based on VeriStand 2010 and will not work in 2009, with the exception of the replay custom device which I think is available for 2009.
NI VeriStand 2010 provides advanced, integrated support for NI-XNET CAN, and it has incremental enhancements to the Stimulus Profile Editor. The 2009 Stimulus Profiles are limited to one table of imported data. You can't separately import multiple files into a profile like you can in 2010.
If your target doesn't have enough memory to hold your large traces, you might look into a custom device-based solution for playing data onto CAN channels.
Honestly, I am not sure what format ncl files are. I doubt it's text-based, but I could be wrong.