09-04-2008 06:08 AM
Hi ,
I have just received a new PXI 8461 CAN card and have a question about it as I have never used Labview with CAN before.
I found the CAN transmit - event based.vi in the LV7.1 examples and ran it with CAN0 as my interface.
I have not connected the device to any other device except for a scope probe on Pin 2, CAN L to see it it would transmit.
When I toggle the Write button on the VI the CAN card transmits the data and keeps transmitting, even though the Write button has changed back to False. This VI is supposed to be event based and only transmit 1 Frame on each button press.
Am I missing something ?, I have a 120R resistor across the pins 2 and 7. Why is the card continually transmitting ?
Thanks !
09-04-2008 08:18 AM
seems to have sorted itself out now.
From what I have read about CAN its not a good idea to have only 1 node on the bus.
I connected up a target device and it works fine with that.
On a related subject has anyone ever used CAN Network Management with Labview ?
My project involves setting devices to sleep / waking up, determining faults if devices do not sleep etc.
Would the CANopen library be my solution ?
Thanks.
09-04-2008 10:13 AM
No, CANopen is not a solution for your needs. But NI-CAN brings examples for setting devices to sleep and monitor error frames and error states.
You should dig a little deeper into the examples and you may find the right solution faster then you thought.
DirkW
09-05-2008 07:17 AM
Thanks DirkW for your help.
I have noticed that most of the examples in the help use the Frame API instead of the Channel API. This I think is odd since in the NI_CAN pdf file it recommends using the Channel API unless synchronization is required which leads me to another question.
Is it possible to Sync a CAN message being transmitted / recieved to an Analog output / input on a 6052E or 6733 card.
I have tried using the CAN Frame API Output DAQmx Output.vi in the examples with PXISlot2/ao0 as my analog output/input.
However I get error 1074388697, timebase disappeared message. These cards use PFI inputs as opposed to RTSI (not sure what difference is though).
Thanks,
09-08-2008 09:00 AM
You should use the example finder from labview or browse the examples/nican directory within your LabVIEW directory to see all the examples shipping with the driver. There are as many examples for the channel api as for the frame api.
The mentioned example is coded for PCI boards, that uses RTSI lines to synchronize. Your PXI board however uses PXI Trigger lines and that means you have to change the string RTSI to PXI_TRIG within CAN Sync Start Series 2 Frame API with DAQmx.vi" in order to get it to work.
DirkW
09-10-2008 09:10 AM
Hi DirkW,
I followed your suggestion about renaming the string from RTSI to PXI_TRIG within the "CAN Sync Start Series 2 Frame API with DAQmx.vi" however I still get a error 1074388697 timebase disappeared.
There are 2 mentions of RTSI in this VI and I had to rename them both. Please see attached jpg picture.
What does this error mean ?,
I understand that there needs to be a Master Timebase and a Start Trigger for the vi to work.
Is the 20Mhz clk on the 6733 card the MasterTimebase which is supposed to link to the master Timebase of the CAN card.
Also is one of the PXI_TRIG lines routed from the 6733 to the Start Trig of the CAN card ?
Thanks,
Mike
09-11-2008 09:35 AM
Ok, there are three possible root causes for this problem. First, have you identified your PXI System (Controller and Chassis) in Max. Thats important because it configures your Trigger Lines. Second, is this a PXI chassis with more then 8 slots? If yes is one of your synced boards located in a slot higher then Slot 6? If yes then you have to export your Trigger Lines to the the extended slots. you can do that within the Trigger configuration dialog in Max >>PXI System. (see First cause).
And, three, your PXI Chassis may be damaged and your Trigger bus is not working correctly.
Hope that helps
DirkW
09-11-2008 10:25 AM
Thats it DirkW, My CAN card is in Slot 8 and My 6733 card in in slot 3. I have a PXI 1045 chassis.
By configuring the Output lines to be Away from Slot 1 the VI ran fine.
Theres a useful link here which explains it if anyone else comes across the same problem.
http://digital.ni.com/public.nsf/allkb/CA9A49FA50393C4186256DC200774E2B.
Thanks again.
Mike