LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unusual CAN problem.

The top structure runs as expected, but in the lower structure only the first VI, "SN MAIN", runs correctly. The only difference between the two structures is that I've switched the "PORT STATUS" and "READ VERSION NO" VIs around.

 

In the lower structure the "READ VERSION NO" and "PORT STATUS" VIs run but they run as if the objhandle was incorrect or something like that. However I have put probes between all VIs and the objhandles look good. Does anyone see anything that might be causing my problem?

 

Thank you.

0 Kudos
Message 1 of 6
(2,875 Views)
By not using the "Prompt User for Input" and instead using a VI to obtain users input my problem disappears, but I have no idea why.
0 Kudos
Message 2 of 6
(2,855 Views)
It will be difficult for us to help without the subVIs.
0 Kudos
Message 3 of 6
(2,841 Views)

Attached are the VIs.

 

Thank you.

0 Kudos
Message 4 of 6
(2,826 Views)

Hi chuck72352,

 

Looks like there are still a few VIs missing that we will need to see what's going on in your top level VI.

 

  • CMM_Port_Status.vi
  • Ver_No_TEMP.vi
  • SN_MAIN_TEMO.vi

 

Also, you mentioned that it runs as if the objhandle was incorrect. What do you mean by this? Are you receiving any errors? Try placing a Simple Error Handler.vi at the end of your program to display any errors that have been passed along through the error wires.

 

You also mentioned that by using the VI instead of "Prompt User for Input", the problem went away. Will you please elaborate about this? Where in the code are you prompting for input?

 

Lastly, please give us a high level overview of what this code should do. Knowing the end goal will help us understand what's happening.

 

 

Have a great weekend!

 

 

John M

National Instruments
Applications Engineer
0 Kudos
Message 5 of 6
(2,809 Views)
In my application I have VIs that use several CAN functions. When I use separate CConfig and COpen and a separate CCLose for each VI everything works fine. However my application is a large test system and runs continuously so I would like to minimize the number of times the CAN bus opens and closes. To do this I tried using ObjHandles between the VIs and while this works sometimes, for example if I string two of the same VIs together, in other instances it doesn't work. The ObjHandle appears that it is being passed properly, but the CAN functions act as if it is not opened properly, or possibly does not have all the configuration information that's needed. It should also be noted if I try the VI by itself with the CConfig and CCopen and CClose functions external to the VI by itself everything also works fine. I also tried writing the ObjHandle to a global but that didn't work either.
0 Kudos
Message 6 of 6
(2,801 Views)