I wish to simulate an engine using LabVIEW, including the crank angle and cylinder pressure signals output, and be able to control in real time the speed (rpm) of the engine, and the frequency at which samples of this data are stored to disk. I wish to be able to open the file that data has been wrote to, to inspect it, validate it, and later analyse it.
To do this I have set up an FPGA program and an RT program, with an FPGA interface communication between them. The FPGA simulates a motor vehicle engine, creating a crank angle and cylinder pressure signal. This is run in RT mode, with an RT program controlling the FPGA engine speed and the number of data samples to be sent to the RT program, per crank cycle. I am using a wait on IRQ command so that only the data points required are sent over the communication bus I have between my FPGA NI PXI-7831R and RT NI PXI 8186, which are in a NI PXI 1042 chassis.
The FPGA program works fine, and sends data to the RT program at a rate of up to 30kHz. However I don't know the best way of storing to file, as using a simple write to excel spreadsheet function directly from the FPGA-RT communication in the RT program, in a while loop, stores some data points more than once, and misses out many points. The problem is it does not write only every time a new data point it sent to the RT program, and it doesn't seem to write fast enough.
I have tried many different ways of achieving the same thing, as yet to no avail, could anyone give me some pointers please?
Thanks,
Emmanuel