LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ni-can simulation software

Afternoon all~

 

Quick question - I am trying to find out if there is a "simulation" vi in examples or somewhere on the site that can be run on FPGA or Real Time cRIO device that would emmulate engine bitfile communication (from an engine ECU) that could be read and translated into useable string and array/cluster data by coding that I would write.

 

Basicaly I am trying to write and test code that will traslate J1939 data from a Cat Engine and make a user display screen with the engine parameters. So can I do this with some example code or is the only way I can get a test signal is from something like the CAN Device Simulator?

 

system info that I have

 

cRIO 9023

Chassis/FPGA 9114

(2) NI 9862 modules

 

I have no code to show at this time as I am working out all the testing hardware/software needed to do this. (short of running an actual engine in my office.)

 

Thanks.

0 Kudos
Message 1 of 5
(2,973 Views)

Which part exactly are you trying to simulate? While I haven't investigated every example, I don't know of one that specifically simulates engine data. If you have a log file containing raw CAN packets received on a real system, you can probably use those to simulate the engine data without too much work, since CAN packets are relatively small and simple.

0 Kudos
Message 2 of 5
(2,957 Views)

I am trying to simulate the data stream that would come from an engine over a J1939 protocol.

 

In all honesty, I really don't care if it is actual engine data - meaning the data received could be pointless just as long as it follows J1939 protocol for byte size and coding...

 

I was thinking about your second point as I have access to actual byte strings for specific J1939 code (from a book) as I have had to utilize this kind of communication in the past with Parker IQAN program development. But I don't think just running the actual bit messages in a while loop with a data output could really work as a simulator, could it?

 

Ultimately, I want it to be able to read by a top level vi to display that info on a PC. I have the graphic side done but would like to start developing the code for the communication between the vi and the engine.

 

 for what its worth here is a front panel screenshot. There is no code behind it as everything is only indicators (i.e. the destination)

0 Kudos
Message 3 of 5
(2,948 Views)

Where is that VI running? The typical design pattern would be to have that VI running on a host computer, with some means of sending data from the cRIO to the user interface. Is that what you're planning to do here? At what level are you trying to generate the simulated data? That is, are you trying to test the CAN message parsing, or passing data from the cRIO to the user interface, or just the user interface component? I'm asking more to get you thinking about what you want to do. There's not a ready-built simulator that I know of that will generate the data you want; somewhere along the way you need to write code that either generates reasonable numbers or reads them from a file, and it's a question of where you want to do that.

0 Kudos
Message 4 of 5
(2,932 Views)

That vi is running on the user interface (touchscreen) PC. It is ultimately going to be designed as a called vi (asynchronously or something similar) as It does not need to be seen all the time. I was thinking that because it does not need to be seen visually all the time I can run it on the RT target via Scan Engine and pass the info up to the vi through P2P, CVT or AMC I have not decided the best way yet.

 

But there is a catch though as the info on that vi is also needed for the alarm protocol in order to send commands to the engine if there is a failure in some system that needs to shut the engine down for safety. I was thinking I would run the alarm vi on the RT target as well as it does not really need a front panel.

 

So I am trying to generate the simulation data from as close to the hard input as possible. FPGA maybe? If I can't do that programatically with a vi then I will probably have to break down and get the NI CAN Device Simulator (external DAQ device) and see if I can get something to work that way.

 

Dunno, I will think on it over the weekend and see if I can come up with a vi that would run on the FPGA and send random string data to the RT target that can be extrapolated into numeric that can be read on the indicators.

0 Kudos
Message 5 of 5
(2,926 Views)