Re: Ramp meter.
Daniel wrote: In a virtual instrument, I have choosed a numeric meter for the front panel. It is configurated with RAMP (from Item visible). But this ramp just has 3 colors, and I would need 6. How can I do to add 3 colors to the ramp? Hello Daniel, To add more colors to the ramp, you can use the 'Scale.Marker Values[]' property of the meter. This takes an array of value-color clusters. For colors, you can use the Color Constant from the Additional Constants of the Numeric functions palette and then use the color picker (brush) to set the desired color. See diagram below for an example: http://home.austin.rr.com/kansari/misc/rampcols.png Hope this is what you were trying to do. Regards, Khalid Ansari
Re: Labview 7.1 released 5/4/2004
Andrew Johnson wrote: what, if anything, has changed in DSC? There is a new version of DSC as well, 7.1, but there doesn't seem to be a listing of new or modified features. LabVIEW-DSC 7.1 Release Notes has the new/modified features: http://www.ni.com/pdf/manuals/322955d.pdf Regards, Khalid Ansari
Re: MODBUS
Hi Olivier, You may want to search this list's archives for info' on Modbus and LabVIEW. There's bunch of postings on this topic. Use: http://www.searchview.net/ I guess this is a good idea, in general, to check the archives before posting any question. Regards, Khalid Ansari - Olivier Zimmermann [EMAIL PROTECTED] wrote: 05/05/2004 04:27 AM Subject: MODBUS Bonjour, I am looking forward to command a MODBUS device (Eurotherm 2208e Temperature Controller) with LabVIEW. What is it possible to do with such a device ? Do you have infos, advices, ressources about this, or MODBUS handling in general ? oz
Re: LV serial interface for Automationdirect GS2 drives?
Hi Michael, Modbus is a simple, open communication protocol originally created by Modicon/Schneider Electric. Though it has been widely used by others and considered open for several years, only last week did they give up their copyrights for it. The Modbus protocol can be found here: http://www.modicon.com/techpubs/toc7.html Modbus-IDA now maintains it: www.modbus.org There are several options for communicating to Modbus devices from LabVIEW: 1. Write your own driver - Modbus is a simple protocol so you can write a driver, or part of it that you need in LabVIEW. You'll use serial/VISA as with any other serial driver (note that there's a Modbus-TCP protocol as well). The protocol specification above should give you an idea of what's involved. In addition, C/C++ and VisualBasic APIs are also available. 2. Use existing LabVIEW VIs There are several VIs available out there (none from NI though; some are from Alliance members). Some of these are free: http://www.air.nl/nlibrary/modbus_vi.html http://www.users.globalnet.co.uk/~pseudo/downloads.html (see Eurotherm; uses Modbus) http://www.softwarewithrelish.com/specs/BusVIEW.html http://www.ewebsite.nl/eng/html/modbus.html http://www.saphir.fr/SAPHIRnet/API/ModBusVIEW/index.htm http://labview.citeng.com/pagesEN/products/modbus.aspx Etc... 3. Use an OPC Server - As Modbus is heavily used in Industrial Automation, there are several OPC Servers available for it, including one from NI: http://ni.com/opc/opcservers.htm Here you'll find a free one from Matrikon: http://www.matrikon.com/drivers/FreeDownloads.asp In LabVIEW, as you very likely know, to talk to an OPC Server, you would either use DataSocket, or use the DSC module which has built-in support for OPC, and is recommended over DataSocket especially when you have a bunch of IO points. 4. Use an ActiveX Server - There are ActiveX Servers available which talk Modbus. http://www.automatedsolutions.com/products/modbusrtu.asp A Google search returns a bunch for these. In your case, the turning of the motor, reading its speed, etc., really is writing and reading of the correct coils (discrete points), and registers. These will have addresses which the GS2 documentation should provide. Hope this gets you started. Regards, Khalid Ansari Ross, Michael [EMAIL PROTECTED] wrote: Hello generous souls, I could really use a shortcut to running my new GS2 motor drive from Automation Direct. It has an RS232 interface and can be communicated with via MODBUS. The normal path to running these drives is via a PLC. Since I have a PC with a serial port, I wonder why I would care to use a PLC. I would like to command it directly with LV. I would like to do some very simple things like: turn the motor on verify that it is on or up to speed get the motor speed turn the motor off verify that the motor is off Unfortunately, MODBUS is one of those acronyms I have always read over quickly with out comprehending. Any advise or snippets will be appreciated. Michael E. Ross Senior Design Engineer Standard Motor Products, Inc. Engine Management 2717 Commerce Road Wilson, NC 27893 ---
Tabbing position in a cluster
Hello John, You can use the 'Controls[]' property to get refnums to the controls in your cluster. This array is indexed as per the cluster order (and thus tabbing order). For each control refnum, the 'KeyFocus' property would tell you if it's in focus currently, implying if it's the one that's been tabbed to currently. I am attaching a simple VI demonstrating this (private mail only). In the code where you handle your menu ring selection, you can set to true the KeyFocus of the next control in the cluster. This way the cluster won't forget the tab order. Hope this helps, Khalid John Brohan [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 04/08/2004 11:27 AM To: [EMAIL PROTECTED] cc: Subject: Tabbing position in a cluster I have a 35 element cluster which contains some menu rings. The user can tab through the cluster entering his data. However when he uses the menu ring the tabbing forgets where it was, so the next tab gets you out of the cluster. I would like to set the cluster element the focus is to go to when he hits tab I would also like to be able to know where I am in the cluster? Yours Sincerely John
Re: Large Fonts
Hi Jim, I tried this and the LOGPIXELSX and LOGPIXELSY did not change on changing the font settings. The values remained at 96. Anyways, here's how I retrieved them: 1. call the GetDesktopWindow from User32.dll: unsigned long GetDesktopWindow(void); 2. call GetWindowDC from User32.dll, passing the value returned from GetDesktopWindow above: unsigned long GetWindowDC(unsigned long hwnd); 3a. call GetDeviceCaps from gdi32.dll, passing the value returned from GetWindowDC above, and 88 as the value for LOGPIXELSX: unsigned long GetDeviceCaps(unsigned long hdc, long LOGPIXELSX); 3b. call GetDeviceCaps from gdi32.dll, passing the value returned from GetWindowDC above, and 90 as the value for LOGPIXELSY: unsigned long GetDeviceCaps(unsigned long hdc, long LOGPIXELSY); I also tried calling the GetTextMetrics function, and its tmHeight element (which is supposed to change with font setting) doesn't change either. I always get a value of 16 for it. Call this from gdi32.dll, passing the value returned from GetWindowDC above, and a pointer to Int32: unsigned long GetTextMetricsA(unsigned long hdc, long *tmHeight); Not sure why the values don't reflect the change in settings. Hope you can dig more into this. Regards, Khalid Ansari --- Jim West [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 03/26/2004 09:07 AM To: [EMAIL PROTECTED] cc: Subject: Large Fonts To All: Can anyone offer any suggestions (or have a VI) to programatically retrieve the 'Large Fonts' vs 'Small Fonts' setting in Windows? I stumbled around the Microsoft knowledge base for a while but only uncovered the 'GetDeviceCaps' API. The API seems to have a different prototype on my machine versus what MS describes. MS refers to LOGPIXELSX and LOGPIXELSY but I can't seem to figure out how to retrieve them from within LV. Any ideas? Jim West Summitek Instruments
Re: Subject: How to get the name and status of the windows, programmatically?
This bounced back the first time.. sending again... --- Hamid, You can use the EnumDesktopWindows function from windows API. This function enumerates all open windows and passes their handles to a callback function. The callback function can then check the state of the windows using the handles passed-in, and in turn calling other windows functions like IsIconic, IsZoomed, etc., See MSDN for more details on these functions. You can implement the EnumDesktopWindows and the callback function in a dll. And call the exported function from LabVIEW. Here's some code snippets.. it pops-up message boxes with the windows' states: // This is an exported function.. call this from LabVIEW extern C WINFO_API int fnWinfo(void) { return EnumDesktopWindows(NULL, EnumWindowsProc, NULL); } // callback fn which EnumDesktopWindows calls BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) { char wname[256] = ; GetWindowText(hwnd, wname, 256); if(!IsWindowVisible(hwnd) || strlen(wname) == 0) { //not a valid window -- do nothing } else { if(IsIconic(hwnd)) { MessageBox(NULL, strcat(wname, -- minimized), , MB_OK); } else if(IsZoomed(hwnd)) { MessageBox(NULL, strcat(wname, -- maximized), , MB_OK); } else if(GetActiveWindow() == hwnd) { MessageBox(NULL, strcat(wname, -- active), , MB_OK); } else { MessageBox(NULL, strcat(wname, -- restore/other), , MB_OK); } } return true; } Your LabVIEW dll node will look like: unsigned long fnWinfo(void); Caveat: The above code was put together in a jiffy for proof-of-concept only; it's not perfect. You can easily modify this to return the info' to labVIEW (instead of the msg boxes). Note that the EnumDesktopWindows actually returns a bunch of windows without any names; we filter them out above. Hope this helps. Regards, Khalid Ansari - Forwarded by Khalid Ansari on 03/04/2004 11:29 PM - [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 03/03/2004 07:42 AM To: [EMAIL PROTECTED] cc: Subject: How to get the name and status of the windows, programmatically? Hi List I need to get the name of all the windows that are open. Also, I need to find out the status of the windows i.e. Which one of them is maximized or minimized? (This is NOT limited to Labview windows, any other window must be included) How can I find out which window is active? Any help is appreciated Thanks + Dr. Hamid R. Yazdi
Re: [W] Getting IP address of a local network interface
If you have multiple network cards, you can get their IP addresses from the registry. This is a two step process: 1. Enumerate the network card keys by reading the subkeys at this location: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards For each of this subkey, read its 'ServiceName' value. 2. Append the 'ServiceName' values to the following key and read the 'IPAddress' value: HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces If you're using DHCP, you'll instead read values for 'DhcpIPAddress.' Hope this helps. Khalid Ansari Does anyone know of a way to get a list of the IP addresses associated with network interfaces on a Windows PC running LabVIEW? I could call IPCONFIG with a System Exec node and parse the output but that's a dirty hack, so I'd rather not. Simon Whitaker [EMAIL PROTECTED]
Re: Wonderware and Labview?
There are a few ways you can integrate Wonderware and LabVIEW: 1. OPC -- Wonderware supports OPC. You could either use LabVIEW-DSC which is both an OPC Server and a Client. Or, use DataSocket to talk OPC. 2. DDE -- Wonderware originally used DDE for IO communication. They still support it. 3. Listing this one just for the sake of it, it's not practical IMHO: create (or search for) a Modbus Slave in LabVIEW, and use serial port to talk to it from Wonderware. Hope this gives you some ideas. Regards, Khalid Ansari - Forwarded by Khalid Ansari on 02/16/2004 10:12 AM - [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 02/16/2004 09:47 AM To: [EMAIL PROTECTED] cc: Subject: Wonderware and Labview? Hi; May I ask the list: 1- Has anybody tried to integrate a Labview code with wonderware? 2- How is it possible to communicate with wonderware? Basically, I want to have an application in Labview and the client wants the results of the test to be shown in wonderware front panel. I don't know anything about wonderware but I assume it must be possible to pass the data to this application, somehow. (I am going to use my own PC and talk to wonderware on another PC or whatever hardware that it is using) Maybe RS232, or ethernet, or even I/O? Any help or ideas are much appreciated PS. After spending long time learning LV (and still don't know much), I don't fancy starting to learn Wonderware (maybe I will have to though:) Cheers + Dr. Hamid R. Yazdi Federal Mogul Manufacturing technology 3935 Research park drive Ann Arbor, MI 48108 Tel: 734 222 4108
RE: Serial comms
Hello Craig, I would like to recommend PortMon -- a freeware utility to monitor all serial (and parallel) port activity with myriad features. http://www.sysinternals.com/ntw2k/freeware/portmon.shtml I've found it to be an invaluable tool for troubleshooting serial comm issues.. in fact we joke about it as PortMon -- An Engineer's PokeMon! Hope you find it equally useful. Regards, Khalid Ansari - Forwarded by Khalid Ansari on 02/13/2004 11:29 AM - Craig Graham [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 02/13/2004 06:30 AM To: [EMAIL PROTECTED] cc: Subject: Serial comms [clip] Since I have a laptop and 6036 card lying around, and I have a demo program for this reader, I think I'm going to end up doing a simple serial analyser and seeing what the differences are between my code and the demo. But that's not going to happen till next week and it will waste quite a bit of time so I thought I'd see if anyone had suggestions. [clip]