03-08-2010 07:36 AM
Hi,
I am using a RichTextBox with a Callback VI attached to the Keypress event. Everytime I cause the kepress event to go off I get the attached error.
I have created a small project to demonstrate the issue, also attached.
I'm running Labview 2009 but have seen the issue on other version as well.
Any ideas on what is causing the error would be most useful. Have not implemented the CallBack VI correctly or is there some other issue I need to be aware of?
Thanks
03-08-2010 01:28 PM
I don't have 2009 running right now to see your code, but I just tried a simple KeyPress Event Callback with 8.2 and 8.6 and it worked just fine - no crashes. As soon as I have 2009 running again I can try to run your project.
P.S. Your images in the message point to files on your hard drive. If you want to embed images you first need to upload them to NI's servers.
03-10-2010 04:53 AM
As best I can tell my attachements are uploaded to the server, at the following addresses:
http://forums.ni.com/ni/attachments/ni/170/480510/1/Error%20message.png
http://forums.ni.com/ni/attachments/ni/170/480510/2/RichTextBoxCallback.zip
I have also saved the VI's for previous versions of Labview and on 8.5 with the same code the issue does not occur.
Thanks
03-10-2010 05:08 AM
A slight addition to my previous post....
The error message is not displayed in 8.5 but action of the Callback VI is not performed either.
Attached are the simple VI's I'm using saved in 8.2 format.
03-10-2010 09:16 AM
Your original message contains 4 broken images, and each of them shows a source as being your hard drive. If you right-click on the first one, for example, it has a source of "file:///C:/DOCUME%7E1/daver/LOCALS%7E1/Temp/moz-screenshot-1.png". It appears as if you were trying to embed images into your message.
The 8.2 version of your code worked just fine on my 8.2. When I tried the original LV 9 version it crashed as you experienced. When I tried to recreate the VI from scratch I ran into an additional issue. When I created the callback VI the control reference placed on the callback VI had no assigned class. Thus, if you connected it to an Invoke node no methods showed up (since the class for the control wasn't set). I would concur that some "funny things" are going on with LV 2009 and .NET, at least in this case. Of course, this is pretty much par for the course with LabVIEW and .NET since LV 7.
03-10-2010 09:29 AM
03-10-2010 09:34 AM
Ruffdi wrote:
If you right click on the Control Ref on the front panel of the CallBack VI you can "Select .net Class" and then the invoke node will allow you to select methods related to the Richtextbox.
Yes, I know that. My point in mentioning it was that this did not happen in previous versions, and it shouldn't be required to be done in the first place. Clearly, something is not quite right with LV 2009 in this case.
03-10-2010 09:49 AM
03-10-2010 09:58 AM
03-15-2010 11:41 AM
Hello Ruffdi,
In order to get your 8.5 code to work as intended, you should wire the RichTextBox reference to your User Parameter input on the Event Callback (see pic below), and you should see the "KeyPress Detected" appear on your front panel.
Also, make sure you add a little delay in your while loop, and a Close Reference function at the end of your code right after the while loop, to close the reference you open with the RichTextBox.
I hope this helps for now, as I cannot find a workaround to the issue we are seeing in LabVIEW 2009.
Let me work on this slightly more and see what we can do.
smercurio_fc, thank you kindly for all your help so far, it is much appreciated.
Kind Regards,
Michael S.
Applications Engineer
NI UK & Ireland