From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems when running without block diagram open

Hi,

I have a problem when running some of my VI's without opening the block diagram. As I open the VI, only the front panel pops up (as it should be?), and when it is run I get an "Access violation (0xC0000005)". However, when I open the VI and then also choose "Block diagram" under  "Window " in the toolbar,  I don't get any problem at all. Does anyone know what difference is when running av VI without Block diagram being open? Would be very grateful for any help since this issue occurs at several VI's.

0 Kudos
Message 1 of 17
(2,702 Views)

Hi Mersad,

 

This is not typical behavior, but I can't say more unless you provide more information. Please describe your VI in more deail. What version of LabVIEW are you using? What does your VI do?
If possible, post a copy of the VI.

 

 

 

 

~~
0 Kudos
Message 2 of 17
(2,675 Views)

Hi,

I suspected someone would ask for that, so I'll post it below, but my intention was to ask a general question regarding the difference of running with Block diagram and/or with probes. The copy of the VI is from a subVI which I am using to read from a digital input channel. I might have solved the problem by adding a 10ms wait (as can be seen in the middle of the pic), but I am not completely sure of why it works. It seems like there might be a small delay of initiating the digital input channel which leads to the "Access violation", 10ms delay before reading seems to be enough, but how can I be sure that it will always be enough? I tried to search for similar problems at the forum and I read at one place that there might be a race problem for similar applications, so that's why I added the "Wait".

 

Is this safe? Is there a better way of making sure that the channel is ready to be read?

0 Kudos
Message 3 of 17
(2,656 Views)

I forgot to add that I'm running LabView on a PC with Windows 7 along with PXI-1044.

0 Kudos
Message 4 of 17
(2,650 Views)

I'm suspecting that Reset Device might need the wait before you can actually read from it.  A lot is happening when you reset a device.  I also don't see a need for the Start DAQmx Task since you are defaulting to a single shot sample.  You just need the DAQmx Read and it will do the Start->Read->Stop for you.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 17
(2,645 Views)

You have a couple of questionable structures there.  An Action Engine (Ben's famous Action Engine Nugget is always a good read. http://forums.ni.com/t5/LabVIEW/Community-Nugget-4-08-2007-Action-Engines/m-p/503801) Is uasually a Case inside a single itteration while loop with a Shift register to store private data (optionally a Feedback node can act as the AE Private Data stroage mechanism) inside a error/no error case .  Your outer While loop makes no sense and adds nothing to the functionallity. 

 

Whith a N chan Single sample on demand DAQmx Task I would not use the Start Task inside the configuration case.  Use Control Task instead and chose "Commit"  The task will "Autostart" when the Read is called.  Using the Start Task in this location involves an implicit state transition that is undesireable since every read now needs to complete by transition all the way back to the state befor the implied transition ( Verified).  See Here for further explaination 

 

@ Tim Reset device returns when reset is complete or timeout error


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 17
(2,644 Views)

Thanks! I will try swapping Start task to Control task with Commit. Agree that the outer while loop is useless, will delete it. I didn't get the link to Ben's famous Action Engine Nugget to work, can you maybe repost it?

0 Kudos
Message 7 of 17
(2,625 Views)

Action Engine Nugget

 

 

There was an unneeded parenthesis at the end of Jeff's link that was causing a problem.

0 Kudos
Message 8 of 17
(2,614 Views)

Hi again,

I tried to swap Start task with Control task, but I still got the "Access violation"-message. This actually comes on of the two computers I'm working on, the other one didn't have this problem after I added the 10ms wait earlier.

0 Kudos
Message 9 of 17
(2,580 Views)

Hi Mersad,

 

I cannot find any documentation regarding your original question (difference when running a VI without block diagram being open), so I would say no, there should not be any difference as long as you do not use any block diagram feature that slows down/halts the code execution itself, such as execution highlighting or breakpoints.

 

You say that you experience this problem on two computers? But on one of them, it helped by adding a 10 ms wait? What version of LabVIEW and DAQmx do you use?

 

You report "Access violation (0xC0000005)", but this is a rather general error. Do you get any more text/info together with the access violation?

 

 


0 Kudos
Message 10 of 17
(2,567 Views)