Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulink DLL not communicating with FPGA

Hello,

 

I'm evaluating a test setup that uses FPGA and SIT and struck with an application that uses LabView Simulation interface toolkit (SIT) with PXI 7833 FPGA card. Below is the problem description.

 

I have a Simulink generated DLL that takes a PWM duty cycle as input and outputs corresponding voltage and current. Using SIT, I created a Host VI with a control mapped to duty cycle and indicators to voltage and current. I also chose DLL to run on a Real time Target. When I run the Host VI, and change the duty cycle, voltage and current are as expected. Next, in the same Host VI, I incluided a while loop containing blocks for updating PWM inputs from a hardware and voltage/current outputs to the hardware through PXI 7833 FPGA. There is an Input/Output VI already compiled and running in FPGA. I have IRQ's (Interrupts) to communicate between FPGA VI and Host VI. I then used local variables inside Host VI while loop, to update the control and indicators mapped to DLL.

 

The problem: DLL funcion in Host VI doesn't seem to update the PWM input (and hence no output), though when I probe signals in DLL function, it's running. I disconnected FPGA PWM input local variable inside while loop  and then connected the same to a separate slider controller. When I move the slider, Host VI runs the DLL, updates FPGA IO's and I can measure the desired voltages and currents using a multimeter.

 

Any help would really be appreciated. Thanks!

 

Tenil.

0 Kudos
Message 1 of 3
(3,571 Views)

Tenil:

There are several possibilities why your Simulink DLL is not returning the values you expect when running on the real time hardware, yet it runs when you do a "run" from the LabVIEW environment (PC host) while linked to the realtime target via ethernet cable. 

Among them are:

  Is the loop with the DLL being run at the same speed on the real time hardware as it is on your PC?

  Did you FTP a copy of the DLL to the real time target?  Can the Real time target find the DLL?

  How are you probing the DLL if it is running on the PXI chassis?

 

Also, check out the thread "Cannot run Simulink dll at the same time as running real-time target VI" under Most Active Boards>LabVIEW for more information .

 

Hope this helps you to find an answer.

 

Bill

GCentral
0 Kudos
Message 2 of 3
(3,537 Views)

Hi tenil,

 

i heard that one of my colleague is visiting you today. I hope you'll get it up and running. 

 

 

For further detailed questions to the SIT please call our local branch. - It's faster and the "2-way"-communication makes it much easier. 

 

 

Have a great day. 

 

 

With best regards,

 

Ralf N.  

Applications Engineering

Germany

0 Kudos
Message 3 of 3
(3,521 Views)