VISA handle, converted from CVI, gives broken wire
Dear Folks, I have this instrument, new to me, an Agilent 8164B. I have this VXI/PnP driver from Agilent, and I have LV 6.1. According to the manual, I can run the instrument with simple GPIB commands (SCPI commands), but since the driver is there I thought I would try it out first. I downloaded and installed it, and then had to convert it over to LV from CVI. This worked OK, but all you get are LV wrappers for DLL calls. That would be OK, maybe, except that most of these don't run. There is a broken wire between the output of the DLL call (a U32) and a VISA session indicator called iHandle out. I can cast this to a string, and then the connections work, but I doubt this will really work with the hardware. On the input side, a local to this VISA session indicator is used as the source. On the input side, this is automatically type converted to a U32 when it is input into the DLL. What do I need to do to make this work? All I have used VISA for in the past is serial communications, and for the most part that was pretty painless. This is also the first time I have tried converting vi's from CVI. Thanks for your help. Alvin Alvin W. Moore Jr. Measurement Systems Programmer Research, Development, and Engineering Corning Cable Systems Hickory, NC
LabVIEW to Excel wierdness
Dear Folks, I have a LabVIEW app that writes report data out to disk as a tab-delimited text file, then triggers an Excel macro. The excel macro is an auto-open macro, so I have a vi which opens the macro.xla file, then an ActiveX call from LV that tells Excel to run the auto-open macro. This has worked fine in the past, for previous projects, but on a recent project (in which I copied over the same vi's from the old project) I could not get it to work. Now labview opens the text file in excel, opens the macro.xla file, then instead of running the macro Excel just closes both files and nothing seems to happen. I tried several different things with timing, thinking maybe the text file wasn't completely open when the macro was triggered, or some such, but to no avail. I put a pop-up message box in the macro at the start, and that works, it pops up, but after I dismiss it I see the same behavior. This morning, I loaded my old app, and to my surprise it no longer worked either. The only change in Excel is I recently upgraded to Office XP, so now it is Excel 2002 vs maybe Excel 2000 before. I have had to fiddle with the ActiveX calls before for changes in Excel, but I tried all the usual fiddling (delete and redrop the invoke/property nodes, change the property to something else and back again, recompile the vi) made no difference. Does anyone else have any experience with this? I am really doing very little with ActiveX, just having Excel open a text file, open a macro file, and run the xlauto_open macro, then waiting until the number of open worksheets goes to 0 so I can close Excel. Thanks in advance, Alvin Alvin W. Moore Jr. Measurement Systems Programmer Research, Development, and Engineering Corning Cable Systems Hickory, NC
Re: LabVIEW to Excel wierdness - Solution
Dear Folks, Thanks to everyone who replied to my question about LabVIEW and Excel and ActiveX (repeated below). I did some more testing and playing around with it. It seemed that both the text worksheet and the Excel macro were opening and running, but the macro was acting as if no worksheet was open and just quitting. I was using the Excel auto_open function, in that a macro named auto_open should run immediately when the spreadsheet that contains it is opened. This worked from the explorer, but does not from a spreadsheet opened via Active-X. So, I had another ActiveX call to actually trigger that auto_open macro. One of LabVIEW's examples was for running a specific macro via Active-X. I tried that and it works, so now I'm using that. This has the disadvantage that now my program has to keep track of the macro sheet name and macro name, but at this point I just want it to work. One response I got from Richard Hill, with some vi's from Duane Cousino, mentioned some differences between Excel 97 and XP. I think the real solution might be that even though I open that text file in Excel, I need to explicitly activate that sheet via ActiveX (only in the XP version, the 97 version did not require this), before calling the auto_open macro. However, I have yet to try this. Thanks again to all who responded. Alvin Alvin W. Moore Jr. Measurement Systems Programmer Research, Development, and Engineering Corning Cable Systems Hickory, NC Previous Message Dear Folks, I have a LabVIEW app that writes report data out to disk as a tab-delimited text file, then triggers an Excel macro. The excel macro is an auto-open macro, so I have a vi which opens the macro.xla file, then an ActiveX call from LV that tells Excel to run the auto-open macro. This has worked fine in the past, for previous projects, but on a recent project (in which I copied over the same vi's from the old project) I could not get it to work. Now labview opens the text file in excel, opens the macro.xla file, then instead of running the macro Excel just closes both files and nothing seems to happen. I tried several different things with timing, thinking maybe the text file wasn't completely open when the macro was triggered, or some such, but to no avail. I put a pop-up message box in the macro at the start, and that works, it pops up, but after I dismiss it I see the same behavior. This morning, I loaded my old app, and to my surprise it no longer worked either. The only change in Excel is I recently upgraded to Office XP, so now it is Excel 2002 vs maybe Excel 2000 before. I have had to fiddle with the ActiveX calls before for changes in Excel, but I tried all the usual fiddling (delete and redrop the invoke/property nodes, change the property to something else and back again, recompile the vi) made no difference. Does anyone else have any experience with this? I am really doing very little with ActiveX, just having Excel open a text file, open a macro file, and run the xlauto_open macro, then waiting until the number of open worksheets goes to 0 so I can close Excel. Thanks in advance, Alvin Alvin W. Moore Jr. Measurement Systems Programmer Research, Development, and Engineering Corning Cable Systems Hickory, NC
text justification in table headers/cells
Dear Folks, Is there a way to programmatically set the Text justification in a table in LV 6.1? I have a table of data in which I want to set all the column headers to center justification, and yet set all the data in the cells (and in the row headers) to left justification. I can't find a way to do this programmatically, and from the UI all I can do is set it one way or the other for the whole table (cells and headers). I know this is really just a cosmetic issue, but it is something I would like to fix nonetheless. If you manually set the headers to be center justified, that only works for the headers you can see. If you scroll over, the new headers that become visible are left justified. Any ideas, anyone? Thanks in advance, Alvin Moore Alvin W. Moore Jr. Measurement Systems Programmer Research, Development, and Engineering Corning Cable Systems Hickory, NC
RE: text justification in table headers/cells
Thanks Dan, but then I would have to use a monospaced font and fiddle with the graphics much more than I want to. I was hoping there was some magic with control refs that I didn't know about that would solve the problem. Alvin. Alvin W. Moore Jr. Measurement Systems Programmer Research, Development, and Engineering Corning Cable Systems Hickory, NC Bookwalter, Dan [EMAIL PROTECTED]To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] eridge.com cc: Subject: RE: text justification in table headers/cells 02/02/2004 11:48 AM Alvin You could however, use the string length and the cell width to progrmatically add spaces to the beginning of your header string Dan Bookwalter N8DCJ Hi-Stat a Stoneridge Co. 345 South Mill St. Lexington, Ohio 44904 (419) 884-1219 Phone (419) 884-4172 Direct (419) 884-4195 Fax [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 11:21 AM To: [EMAIL PROTECTED] Subject: text justification in table headers/cells Dear Folks, Is there a way to programmatically set the Text justification in a table in LV 6.1? I have a table of data in which I want to set all the column headers to center justification, and yet set all the data in the cells (and in the row headers) to left justification. I can't find a way to do this programmatically, and from the UI all I can do is set it one way or the other for the whole table (cells and headers). I know this is really just a cosmetic issue, but it is something I would like to fix nonetheless. If you manually set the headers to be center justified, that only works for the headers you can see. If you scroll over, the new headers that become visible are left justified. Any ideas, anyone? Thanks in advance, Alvin Moore Alvin W. Moore Jr. Measurement Systems Programmer Research, Development, and Engineering Corning Cable Systems Hickory, NC _ This electronic mail transmission contains confidential information intended only for the person(s) named. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you received this transmission in error, please send an electronic mail message to [EMAIL PROTECTED]