LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

About programming with LabView

Hello:

 

I am using LabView 2012. I am using a Producer/Comsumer Desing Pattern (event) to test our product. Recently I had to add Can Bus to the program. I added the Can Bus section below the Consumer Loop of the main program. The program runs OK, but when I test a unit without Can Bus my program collects 150 to 200 point of data, when I run a unit that has Can Bus the system collects any were from 25 to 40 data points.

 

If I place the Can Bus in its own vi and have run separate from the main program and transfer commands and data using global variables or controls would it work or  create more issues.

 

The Can Bus I am using is a cDAQ-9171 with a NI-9862 Can Bus module.

0 Kudos
Message 1 of 4
(2,632 Views)

Hi Toro,

 

adding code "below a structure" isn't a good description of LabVIEW code. LabVIEW uses DATAFLOW, so terms like "below", "left", "right", or "over" doesn't give any information on program overall structure...

 

Run the CAN communication in it's own loop to decouple it from other program tasks!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,626 Views)

Toro wrote:

The program runs OK, but when I test a unit without Can Bus my program collects 150 to 200 point of data, when I run a unit that has Can Bus the system collects any were from 25 to 40 data points.


How does the program collect points of data? Where does the data come from? What determines the acquisition rate (hardware timing, software timing, no timing ("as fast as the computer allows"), etc.).

 

for us to help you, we probably need to see some code. Can you attach your VI?


Toro wrote:

If I place the Can Bus in its own vi and have run separate from the main program and transfer commands and data using global variables or controls would it work or  create more issues..


Correctly programmed, it should not make a difference compared to running in its own loop in the main program. But it would also not speed things up if there is a fundamental design flaw somewhere. Again, show us your VI.

 

0 Kudos
Message 3 of 4
(2,616 Views)

Hello:

 

I use a PCIe 6259 card wtih 2 SCC 2345 and modules on SCC 1 = SG-24, AI07, (3) AI-03, (8) RLY01, (2) AO-10, CTR01, PWR03, on SCC 2 = RLY01, (2) DI01, (4) DO01. I am using a total of 22 channels. The PCIe 6259 has a speed of 2.8MS/sec. according to some information I found I should be able to get about 127,272 S/sec per channel (unless I over looked something).

 

On SCC1 I also use instead of a CTR01 I use the inputs on the terminal block to connect a linear scale with quadrature output. The scale give 1270 pulses per inch witch I use to calculate position. Using the position and time to calculate speed of the moving object. This is what I am having problem with. When I run a product with no can bus control the system collects 200 points of data for its speed. On a product that uses can bus it only collects 25 to 40 points for the speed.

I am using cDAQ 9171 with a NI-9862 throu a USB port.

 

I am using the Master and Slave type VI for the program. The Master has the inputs from the operator and the Slave performs all other task of controlling and collecting updating the status display then processing the data and displaying the results.

Download All
0 Kudos
Message 4 of 4
(2,572 Views)