LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN reading and busoff DAQ in same VI

I need help in developing one application,e.i. to read the CAN input
and measure the time when 1st message is released on the bus after
busoff has taken place.
I need to make busoff in same application by DAQ card using it in
digital mode.

I also want to know how can i use timestamped in CAN init in this
application.

i am waiting for your help
as i am new to LABview .

Thanks
Shanti bhushan
India

0 Kudos
Message 1 of 6
(2,491 Views)
Hello Shanti:

Have you tried looking at our CAN examples in Example Finder. If you go to Help -> Find Examples, then Hardware Input & Output, under CAN you will see many examples including Synchronization with DAQmx examples.
Regards,

Roland A.
Applications Engineer
National Instruments

Check out VI Roadshow
0 Kudos
Message 2 of 6
(2,475 Views)

hi i have developed the VI that can read CAN input and will be initialised and start reading again if busoff occurs.

I need to put timer in that so i can measure the busoff recovery time for CAN

i have attached the VI

please suggest me

i want the time to be measured when busoff occurs till the new message is read after recovery

 

Thanks

shanti bhushan from india

0 Kudos
Message 3 of 6
(2,467 Views)
Hello Shanti:

You could implement a flag, and set the flag when busoff occurs, at the same time get a timestamp. So when the new message is read and the flag is set then you know that a busoff occurred and you can get another timestamp to get the elapsed time?
Regards,

Roland A.
Applications Engineer
National Instruments

Check out VI Roadshow
0 Kudos
Message 4 of 6
(2,448 Views)
Hi Roland A,
Thanks , i have tried it using flag setting.
but i didt got how to start the timer in it.
any how i have used Tick count ,but i could nt foung any kind of watch that could start just by triggering it.
 
so i have used 2 Tick counts the difference of both will give the bussoff time and i have used selector. In false condition  the time difference will be take from Tick count which will start normaly and very high value i have made that as constant,otherwise the difference from Tick count that will start in bus off frame.
To explain u i am attaching that file .
Please have a look.
Another thing i am trying is to enable relay from digital output to make bussoff
0 Kudos
Message 5 of 6
(2,441 Views)
Hey There,
 
I took a look at your code, and I think to get the DAQ working, I think if you could implement a Functional Global Variable. It'd be a good way to get the communication between the two while loops. Here's an article about the functional global variable.
 
I hope I'm not making this more complicated than it needs to be, but I think if you would take a second to experiment with the "Functional Global Variable" it would definitely help you now, and in the future. I'd recommend you make one that has a two inputs. "Reset Time" that resets the timestamp, and another setting "Check Time" and output a boolean true if the time has elapsed. That way, you can have the Variable in both while loops, and it would work well.
 
Unfortunately, there's not much documentation on this type of variable, but if you search google, you should see even more than what I've linked above.
 
Regards,
 
Nick D.
 
 
 
0 Kudos
Message 6 of 6
(2,429 Views)