07-14-2007 09:35 PM - edited 07-14-2007 09:35 PM
Message Edited by John J on 07-14-2007 09:36 PM
07-16-2007 03:04 PM
Hi John,
I would be glad to help you with this question. It sounds like to would like TestStand to call a .NET assembly that pops up your dialog and gathers user input. Then, the user input should be passed back to TestStand and your sequence should continue. I think it may be helpful for you to read this previous post (specifically the very last entry):
http://forums.ni.com/ni/board/message?board.id=232&message.id=4707&query.id=109415#M4707
Does this help? Is it necessary for your .NET dialog to open within the TestStand window (as a child), or is it ok if your .NET dialog simply opens when called by your .NET assembly? I am sure that we can work together to get your program up and running.
Regards,
Casey Weltzin
Applications Engineer
National Instruments
07-18-2007 08:15 AM
Casey,
I apologize for not getting back to you sooner, but my world class company just switched providers last week and we completely lost our internet access yesterday.
As mentioned, I wrote a replacement serial number entry dialog that also accepts input form a barcode reader. The device uses a virtual COM port to send data to the PC. The problem is that when using our custom interface based on the Simple OI, the dialog appears to be the active window, but will not accept keyboard input unless you click on it. I’ve put a couple of hacks into the code to try and work around the problem with no improvement. I don’t require the window to be a child of TestStand, but it should at least behave correctly.
Yes, the example you linked was helpful in showing me that I'm not doing anything significantly different than what others are doing. Before seeing that example, I also found the following NI provided example which made me question whether TestStand implements a good .Net interface, but I later realized that it’s just an old example that uses timers to do things that should be handled by events (probably written by a LabVIEW programmer). It’s the computer motherboard dialog in Examples\Demo\DotNet.
Since I wrote the post, I discovered that the problem apparently only occurs with the C# Simple OI and any modified versions of that code. I have attached the VS 2005 project along with a TestStand 4.0 test sequence file which is in the release directory of the project. This should run without VS 2005 installed. Also included in the project is a C# dialog test application.
Since the code works in VS 2005, the standard TestStand interface, and the other provided interfaces (I have not tried them all), I wonder what is different about the Simple OI. I have not found anything in the provided code that stands out.
Thanks for your help,
John Jurisoo
Evaluation Engineer
ATK
07-19-2007 10:10 PM
07-22-2007 09:48 PM
07-23-2007 09:17 AM
Casey,
Yes, this is a good solution for my situation, and thanks for going beyond the call on this one. I do appreciate the effort. You actually answered my original question, although I asked a broader question in my post. I wasn't expecting anyone to modify my code, but I certainly had no objections. I would have been happy with a few pointers, since finding things in documentation is not always a speedy adventure. I have more trouble with the TestStand classes than I usually do with other packages. I have not been able to establish an intuitive basic understanding of the "reason for the design" yet. It seems a little awkward to me, but it's new to me yet.
it's really a moot point now, but I still wonder what is different about the C# simple interface that exposes this symptom. This is not really something that I need an answere to, since ignoring who the parent window is can get you into trouble.
If I was ambitious and had the time I would use a dialog that allowed an abort from TestStand, but there is no need for this other thatn during debugging. I'll go with the working Buick rather than the "to be designed" Cadillac.
Lastly, if anone tries to use the updated code, a reference to the "NI TestStand API" has to be added to the GetSerialNumber project. Also the TestSNDlg project references the debug version of the GetSerialNumber.dll, so do any testing in VS Debug configuration.
JJJ
07-24-2007 12:08 PM
Hi John,
I am glad that the solution I posed will work for you! Off hand, I am not sure why your modal dialog acts differently in the TestStand development environment vs the C# simple OI. On my end, I noticed that the focus issue occurred for the C#, VB, and C++ simple OIs (but not for LabVIEW or CVI).
Have a great day!
Casey Weltzin
Applications Engineer
National Instruments
07-24-2007 12:18 PM
Casey,
Yes, that is the same behavior that I saw. I just didn't get a chance to test them all till after I wrote the post. It's also funny that the full-featured version of the interface works for those same languages.
Thanks agian for your help.
JJJ
06-30-2014 01:59 AM
Hi,
As for me, I am testing the related c# barcode generator these days. Do you have any ideas about it? Or any good suggestion? I am totally a green hand on barcode generating field. Any suggestion will be appreciated. Thanks in advance.
Best regards,
Arron
06-30-2014 04:45 PM
Arronlee,
I would suggest creating a new thread for your question. You're more likely to get a response that way.
Regards,
Brandon V.
Applications Engineer
National Instruments