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.

FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i simulate a digital instrument using FP

Hi
 
I am a new user of LabView and need to construct an application to verify the operation of data logger programs.  I need simulate data from various analogue and digital instruments using standard test data from a spreadsheet.  I have just about figured out how to take data from a CSV file and set a FP output to this value for analogue values (voltages and 4-20mA signals) but dont really know how to simulate a digital instrument.
 
For example one of the instruments I need to simulate is a rotary encoder which produces a 16 bit binary string representing a value in mm this is done on the instrument as follows:
 
Dataloger sets the enable line high (5V)
Datalogger reads LSB from instrument output buffer (0V = 0, 5V=1)
Dataloger sends 10ms pulse to instrument.
Next bit sent to output buffer on negative edge of pulse
Datalogger reads bit value from output buffer
Datalogger sends 10mS pulse etc etc until all 16 bits have been recieved
Datalogger sets enable line low
 
In order to test the logger programs I have to send test data from a CSV file to mimic the operation of the encoder ie take a decimal value from the file - convert to 16bit binary - wait for enable line on logger set channel x on FP-DI-330 high - send first bit to channel n on th FP-DO-403 - wait for logger to send clock pulse  to channel y on FP-DI-330 - send next bit to channel n etc etc.
 
Any idea how I might do this?
0 Kudos
Message 1 of 2
(2,806 Views)

Good morning Jeff,

I would suggest trying to set up a "triggered" output from your FP modules.  Use FP-DI-330 line as the "trigger" and set the acquisition as a reference trigger.

You would need to create an input line that monitors the digital input (trigger line) and once an input has been received (for 10ms) the digital out would then need to output the LSB and so on.

It may be necessary to implement a state machine structure, that will monitor the input until the condition is met (a trigger input) and then output the desired data.  For more information on state machines refer to:

http://forums.ni.com/ni/board/message?board.id=170&message.id=123485&requireLogin=False

http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_answer=&p_guid=B123AE0CB980111EE034080...

I hope this helps

 

AdamB

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 2 of 2
(2,782 Views)