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.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

digitalwaveformgraph - Date and Time on X axis

Hello,
 
I would like to use the Digitalwaveformgraph Control to display status bits of a control system. I can get the individual bits into the the array to be displayed on the graph. However, I can not get the x-axis to display the time of the status change. The status bits are stored in a simple text file and are time-stamped. I should be able to read the file and display the status bits on the graph but I am not sure how to get the time-stamp onto the x-axis.
 
I would like to use the display as a dianostic tool for troubleshooting the system and display the entire history of status bits with appropiate time-stamps on the x-axis. This history of this data can be in the order of a couple of months or more.
 
Yes, the 'Displaymode' Property is set to 'Time'.
 
What do I need to do?
 
Thanks,
 
Chris
0 Kudos
Message 1 of 11
(5,213 Views)
Hi Chris,

You also need to set the DigitalWaveform.Timing property to a a WaveformTiming object that encapsulates your timing information.  The WaveformTiming class has several static methods including CreateWithNoInterval, CreateWithIrregularInterval, and CreateWithRegularInterval that you can use to create this object. So you could say something like:

DigitalWaveform waveform = new DigitalWaveform(sampleCount, signalCount);
waveform.Timing = WaveformTiming.CreateWithRegularInterval(...

Use whatever method and overloaded methods that best apply to your situation.

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 2 of 11
(5,189 Views)
Bonjour,
Je travaille actuellement avec la carte Pci 6711 sous VBDOT NET, je voudrais savoir comment peut on generer des signaux analogiques sur chaque voie a une frequence identique de 16 khz. Quelle méthod utiliser
Merci
0 Kudos
Message 3 of 11
(5,178 Views)
Thanks for your help Jonathan,
 
There is a great deal to learn about the digital waveform graph and I need to spend some time sorting through it all.
 
I do have another question thou.
 
Since the history of all my plot data can be over a long time (months), I would like to display it on the graph one day at a time (24 hour period) using a calander function. How do I set the Range, Min and Max values for the X-axis programatically?
 
Also, Does NI have a document that discribes ALL of the DigitalWaveFormGraph functionality without getting into the coding details?
 
Thanks
 
Chris
0 Kudos
Message 4 of 11
(5,171 Views)

After trying to set up a digitalwaveform graph to use irregular timing I came across the following error:

code...

Dim wave As New DigitalWaveform(1700, 😎

Dim TimeStamp(1700) As DateTime

wave.Timing = WaveformTiming.CreateWithIrregularInterval(TimeStamp)

NotSupportedException - The digital waveform does not support irregular timing.

Any idea what may be causing this?

Chris

 

0 Kudos
Message 5 of 11
(5,163 Views)
Hi baamr41,

You may find it more helpful to post to the French Discussion Forums.
Jessica
National Instruments
Product Support Engineer
0 Kudos
Message 6 of 11
(5,115 Views)
Hi Chris,

I forgot about the fact that the DigitalWaveformGraph doesn't support irregular timing. The reason it doesn't support this timing option is because the digital waveform data type is meant to be linked with a timing source (i.e. every rising edge of a clock will give us one sample).  Now, you didn't mention how you acquired the data but you did say that you have this data with the timing information stored in a file.  I guess you could have a scenario where your data was a 1 for 10 ns, 0 for 25 ns, 1 for 20 ns, etc.  In this scenario, the time interval isn't the same but it does coincide with what your data is doing (i.e. so if there was a rising edge every 5 ns, then the data would really be 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1.). 

Now, with all that said, what kind of file are you reading the data from? Is it a VCD file?  We do have the Digital Waveform Editor software that can read a VCD file like this.  This software can read this data in and then convert the data to line up with the clock . It also outputs the regular time interval data which can be used in environments that have support for the digital waveform data type. 

Before I move on a provide a final suggestion, maybe you could clarify some on how you are acquiring the data, what type of file format you are using, etc.

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 7 of 11
(5,108 Views)

Jonathan,

I also have discovered that the Digitalwaveform Graph does not support irregular timing. So I have decided on another appoach. The data we are acquiring is captured using various transducers feed into a PLC. From there the data is read into a computer using an OPC Server (I know, network varaibles would be a more modern solution, but that's another story). The data is used to continuosly update a human interface and is stored to various text files when the data has changed (Status Changed). The text files coorespond to the piece of equipment the data originated from and is formatted as follows (comma delimited):

26-Mar-2008,15:00:02,2048
26-Mar-2008,15:00:04,0
26-Mar-2008,15:00:28,8
26-Mar-2008,15:37:54,2048
26-Mar-2008,15:37:55,0

I need to display the data at 1 sec intervals on the digital graph, so I decided to fill in the gaps with unchanged data and plot it with a regular interval. This worked quite nicely.

However, I would also like to have the plot update with live data as it is written to the file so the user can see what is happening in real time. This is the part I am having trouble with now. How do I set this up? Can it be done? Any ideas?

Thanks,

Chris

0 Kudos
Message 8 of 11
(5,104 Views)
Chris -
 
See if the FileSystemWatcher class will meet your needs:
 
David Rohacek
National Instruments
0 Kudos
Message 9 of 11
(5,067 Views)

David,

My problem is not determining when the file is being written to, I already know when the file is written to and with what data. My problem is Appending the data to the Digitalwaveform Graph (plot).

Chris

0 Kudos
Message 10 of 11
(5,063 Views)