Hello, I'm just familiarizing myself with the programming concepts in
LabVIEW and I've run into a somewhat irritating issue with event
handling, probably due to my relative inexperience with events as
interrupts. I currently use LabVIEW 7.0 but will soon be upgrading to
the newer NI Suite.
<block o' words>
In a test program I've been fiddling around with mouse and keyboard
input and for the most part, it's gone smoothly, especially with the
mouse input. However, the problem arises when I attempt to write the
character array generated by the acquire data function for the
keyboard to a string. As a workaround to the difficulty in using that
specific subVI, I've opted to create my own subVI that uses events to
acquire user input and output the results to a string indicator. The
VI I've developed creates, registers, generates, and unregisters for
events and works smoothly on its own, provided I include a while loop
so that multiple characters can be read (I use the key down event).
When I call this VI from my general mouse and keyboard i/o VI I run
into the problem that the mouse input locks up while the while loop is
running to acquire keyboard input. What's worse, the program only
registers keyboard input when the subVI Front Panel is open, only
sending it back when I stop the while loop manually, which is
admittedly a bit of a pain. If I remove the while loop, calling the
subVI for each iteration of the general application, no characters are
read at all, I assume either because the timeout occurs very quickly
or because I need the subVI front panel open to generate the event.
</block o' words>
How can I get the subVI to register a keyboard event that occurs in
its parent VI? Do I need to generate the event externally and send it
in to the subVI? Any help would be greatly appreciated,
Eccomi