Re: Feature request and how-to info for EXE icons
The Application Builder will happily take a .ico file and use it for the icon of my built application, the missing step is only to convert the LabVIEW icon to the .ico file, and that can't be so hard if someone is giving away freeware to do it ;-) It does seem bizarre to me that this tiny feature couldn't be included in the LabVIEW + app builder that we pay a couple of thousand pounds/dollars/Euros for.
Re: How can I open a VI as an independent program out of an other program?
I don't see why it needs an event structure... the simplest way is to make one VI a subVI of the other (it is up to you which way round), use the Front Panel Visible properties of the two VI's to control which one is visible at which time, and use dataflow to ensure that the functions of the main VI only execute after the configuration VI has finished. Assuming the configuration VI displays a panel of settings for the user to adjust, you are going to have to use some kind of structure to ensure you read the latest values of these when the OK button is clicked, so you might as well make it a while loop that also polls the OK button.
Re: Feature request and how-to info for EXE icons
I always thought it was bizarre that LabVIEW's own icon editor can't be used to create an icon for a built application...
Re: create new folders according to the value of the 23th byte in data file?
If I'm not missing something, your diagram will try and create a folder whose name is a single character, equal to the value of the 23rd byte in the data file. Since 1 through 8 aren't printable ASCII characters, I guess this might not work, and I assume the poster actually wants the folders to be named 01, 02 etc. If this is the case, you will want to insert some code between the Read File and Build Path functions to convert the single-character string into the folder name. I'd suggest String to Byte Array, then an Index Array to get the first element (or you could use Array to Cluster with size set to 1, then Unbundle), then Format into String with '%02d' as the format string.
Re: Reverse of Format Date/Time String.VI
No, it doesn't. If you check the online help for Date/Time to Seconds it clearly states that 'day of year' is ignored.
Re: How can I communicate betwen parallel asynchronous VIs?
As long as your subVI doesn't need to keep running after the main (user interface) VI has quit, there's no need at all to use VI Server, or to meddle with control references - just drop the subVI on the diagram of the main VI, outside any loop. To stop the subVI (and start it, if you need to control this too), a notifier should work fine. Create the notifier on the main VI's diagram and wire it in to a terminal of the subVI. You can use the Wait on Notification timeout to control your loop timing, just as you suggested. You could generalise this approach to control the subVI in sophisticated ways - changing the time interval or other aspects of the task, for example - by having it read and interpret the data you send in the notifier (or a queue). Please tell me if I've misunderstood and this doesn't do what you want for some reason, but it seems like it should be all you need. Incidentally, I've never heard of notifiers 'not working with VI Server' and I'm sure I've successfully passed notifiers to VI's called by reference before, but I'm afraid I don't have the code any more to check this...
Re: How to use a USB-to-parallel adapter to communicate with my switch device?
Have you tried using the VISA functions to control the parallel port outputs, as described here?: http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B123AE0CB9CB111EE034080020E74861p_node=ZONEp_source=external I don't know if this will be a complete solution to your problem because that depends on the hardware you want to connect to the parallel port and how it works, but it's probably the easiest way to get started on the LabVIEW side...
Re: can I use any simple VabView7 code vi in ver 5 labview?
If it doesn't use any features of 7 that didn't exist in 5, and doesn't rely on any behaviours that changed between those versions, you could 'save for previous version' repeatedly using older versions of LabVIEW until you reached version 5 (do you mean 5.0, or 5.1?). If you don't have access to any of the intermediate versions, you might be able to ask someone on the forum who has them to kindly do this for you, or one of the NI representatives might do it. Unfortunately I only have 5.0.1 at the moment, so I can't help you! If the code is really simple, it's probably easier to print or save the diagram and recreate it from scratch in the older version!
Re: Clearing a local variable after each read
As Mads comments, this is a perfect application for a queue (and a really bad application for a local!)
Re: What Mac OSes will LAbview 3.1.1 work on?
I'm not sure what you mean by '9.1 is 68k also'. Mac OS versions 8.5 upwards required a PowerPC processor, i.e. they won't run on a 68k machine. However, that doesn't mean they can't run applications written only in 68k code - for example, I still happily run Word 5.1 under Mac OS 9.0.4 on my Powerbook G3! Also, a quick search of the NI site for labview 3.1.1 mac brought up at least one reference to a PowerPC version of this version of LabVIEW - but it appears there were separate 68k and PowerPC versions, so it may depend which version you have. Again, it's not necessarily the case that the 68k version won't run on a PowerPC machine, just that the performance won't be optimised. Remember also that there's a difference between compatible meaning officially tested and supported, and compatible meaning it doesn't crash. It may be a case of just trying to run it on whatever Mac you have and seeing how you get on.
Re: How do I pass data into a sub vi?
Think from the perspective of the VI, not the program: a control is always an input to the VI on whose front panel it's placed, and an indicator is always an output. Whether the control or indicator is displayed to the user or not is really secondary. If you're using a control to both pass data into your subVI and display it to the user, you may want to disable it so the user can't alter the displayed value - that might not affect the operation of your program but it could be confusing! The alternative would be to use a numeric control offscreen as the input terminal to your subVI and wire the value from that control directly into an onscreen tank indicator.
Re: Why does one while loop stop after 3-4 weeks?
I've used Get Date/Time in Seconds extensively for timing things. In my experience at least (mainly LV5.1 on Windows 98), it returns the time the OS currently thinks it is, e.g. in Windows the time currently set in the Date/Time control panel. This means that if you change the system time while your VI is running, it will mess up your timings. This is an important point because changes you make in the Date/Time control panel are instantly applied to the system time even though you haven't clicked OK yet! I don't think there's a problem with the motherboard battery failing though - the PC will start up with the wrong date and time setting but once started it should count up correctly, so relative timings will still be OK.
Re: serial VISA not sending output until closed
Just for the record - since this question came up for me recently - the official answer is that VISA 3.0.1 does support LabVIEW 5.1. In fact it should support any older version of LabVIEW, but that may not be tested/officially supported. See a href=http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101RPAGEID=135HOID=5065000800E9C6USEARCHCONTEXT_CATEGORY_0=_201_%24_13_USEARCHCONTEXT_CATEGORY_S=0UCATEGORY_0=_201_%24_13_UCATEGORY_S=0;here/a...
Re: How to create a 'circular' 30 day file in LabVIEW. the file...
If the file is as small as your example, or even if it's several times bigger, I would just read the whole file into a string, convert it to a string array using Spreadsheet String to Array, use the array functions to strip off the unwanted data and append the new data, then convert and write the whole file out again. If it's megabytes in size but you have plenty of spare disc space, you could read the file in one line or block of lines at a time until you reach the start of the part you want to keep, then open a new file and start writing the lines/blocks out to the new file as you read them in, then append the new data, then delete the old file and rename the new one you have created. There may be a better solution in this case, but this will certainly work. I would be interested in others' comments though, because I once wanted to maintain a rolling buffer like this for audio data (i.e. a much faster data rate) and I didn't find any simple solutions on offer.
Re: Changing the brightness and contrast of an image displayed in a picture control
Pretty much, yes. If you want to play around with image analysis, have a look at the free ImageTool software from http://ddsdx.uthscsa.edu/dig/itdesc.html - the brightness contrast adjustment tool in this program illustrates the idea very neatly. (Mac users of course should get NIH Image from http://rsb.info.nih.gov/nih-image/ )
Re: Changing the brightness and contrast of an image displayed in a picture control
In all the image analysis packages I've seen, the basic brightness and contrast adjustment functions use a simple straight-line relationship between the old and the new intensity - basically z = a + b.z0 where z0 is the old intensity and z is the new intensity value. 0 b 1 would give reduced contrast, b 1 would increase contrast; to change brightness but not contrast keep b = 1 and change a. For RGB images you just process R, G and B identically. A fairly easy task IMHO!
Re: Receiving SMS texts instantly
You don't want a modem, you want to connect directly to your phone - either via a cable, as the previous poster suggests, or via an infrared or Bluetooth connection if this is supported by your phone and PC. There's some pointers to information on how to download SMS from the phone here: http://www.traud.de/gsm/index.html
Re: Running different VIs in parallel
What is it that stops your calling VI from continuing to run while the subVI also runs? LabVIEW code only waits for a subVI call to finish if you have made it do so by some kind of data dependency. If your problem is that you need to pass data to/from a running subVI, you might want to look at using queues, notifiers or globals.
Re: setting a single button to do a task in different loops
Notifiers are ideal for this situation. If your two loops don't necessarily run simultaneously (or fast enough), you might want to make a third loop just for the purpose of reading the button and sending the notification each time it is clicked. One thing you'll have to think about is each time you wait on the notifier, whether you should ignore previous notifications or not. The manual will make it clear what the implications of this are.
Re: passing data to subvi
How about using a queue?
Re: small program generating bar code type serial numbers
One way of doing this would be to initialise a Boolean array with 4096 elements, i.e. one for each number, then use Replace Array Element to set/clear each one as needed, Index Array to check whether an individual number has been used and Search 1D Array to find the first unused number. Another way would be to use an array of integers to hold the numbers that have been used, use Search 1D Array to check whether a given number exists in the array or not, and Build Array to add a new number to the end of the array. To find the first unused number you'd probably have to use a For loop and search the array repeatedly until you didn't get a match, unless anyone can think of a better method. I'm assuming that the used numbers are not necessarily in a continuous block... The advantage of the second way is that you aren't limited to 4096 values, in case you go above this in the future. In either case you can use the standard read/write file functions to load and save the array on disc in LabVIEW binary format, or you can use these together with Spreadsheet String to Array and Array to Spreadsheet String to save as a text file - this would be better for compatibility as you could also read it in Excel etc. Within your program, you might want to use a functional global VI to hold the current array value (in an uninitialised shift register of a while loop), and you could also incorporate the save and load functions in this VI. Hope that's enough to get you started...
Re: Question about slow rs232 equipment
I've come across equipment where a certain command needed delays between characters in order to be recognised, because its microcontroller was too busy doing something else... Admittedly this was a product of the company I worked for at the time and was somewhat funky, but many commercial instruments have been known to show funky behaviour!
Re: I am looking for a indicator like a FLASH LIGH, just show my sequencies moving on.
Only problem with this is that if the program actually does stop working (hangs up somewhere), the indicator keeps animating and the user just learns to hate the lying indicator ;) This is why I curse and swear at the Windows animation of pages flying from folder to folder, which keeps running even when nothing has moved over the net connection for half an hour... or the progress bar in IE5.5 that keeps progressing even though the site is not responding or doesn't exist. Much better to relate your progress indicator to real progress in the program, if you can...
Re: 1D Array Search
I'd guess that the previous method using Search 1D Array would be faster, if your array is large...
Re: I am looking for a indicator like a FLASH LIGH, just show my sequencies moving on.
Just another thought on this though... you could put the frames of your animation into a pict ring indicator and have your program increment the indicator to animate the picture as the task progresses.
Re: OS compatibility
1) Yes, as long as you have the appropriate LabVIEW development environment for the other OS and you aren't relying on platform-specific features such as ActiveX. Any CIN's/DLL's that aren't part of LabVIEW would obviously also need recompiling. 2) No, unless you can get it to work under some kind of emulator like SoftWindows on the Mac. To build an executable for a particular platform you need the LabVIEW development environment and Application Builder for that platform. Maybe someone else can help with the Linux and Embedded XP questions...
Re: importing vi from old LV versions (Mac to Win)
I believe that opening the old VI's and re-saving them in LV 4 would also work. If you don't have LV4 or 5 then a conversion kit for old VI's is supposedly available from NI. You might be able to find a workaround for problem (2) by temporarily moving some of the problem VI's out of where they currently are in the hierarchy (vi.lib?) before you load your old VI's, and/or creating 'wrapper' VI's to go around the new VXI VI's that have the connectors in the places you need. If the conversion in (3) is a problem, can you avoid it by saving the VI's into an LLB on the Mac before bringing them to Windows?
Re: Synchronize read from RS232
If the message transmitted by your sensor is always terminated by a specific character, e.g. CR or LF, just enable that as the VISA termination character for serial reads and set a timeout that is a bit longer than the sensor interval, e.g. 2-3 times as long. Use a VISA Read function and wire a large value to 'bytes to read' (larger than the maximum expected message length). VISA Read will wait until a complete message is received and then return it. If the message doesn't have a termination character, read one byte at a time in a while loop and assemble the bytes into a string or array using a shift register. Use appropriate code to detect when a complete message has been assembled. Either of these methods will return the sensor response to your LV program as soon as possible after the sensor has sent it, which is what I assume you mean by 'on time'. There are two possible problems to bear in mind when you have a device that sends data continuously, rather than in response to a request: first, that readings may build up in the serial buffer before your program starts reading them, and second, that the first response you read may have the beginning chopped off, if you opened the port while the device was half-way through sending something. Make sure you've considered both of these. (Using the 'flush' function can help, but remember you might flush the buffer while the device is half-way through sending!)
Re: Can I build an .exe that will run when opened ?
Sebastian's answer is exactly what you need, as long as you don't mind the whole LabVIEW development environment starting up in order to run your VI (and staying open afterwards). Just put your VI, or a link to it, in the Startup programs group - I assume we're talking about Windows here, of course. If you actually want to create a stand-alone .exe file that doesn't need the development environment installed on the PC where it runs and behaves just like any other .exe program, you need the Application Builder. I don't know if you'll be able to buy this for LV 5 any more, you might have to upgrade to the latest LV version - in which case ask NI for an upgrade price.
Re: two vis different timings?
Just use two separate loops on your VI's diagram, one for the data I/O and one for the GUI. Use queues, notifiers or local/global variables to send data from one loop to the other.
Re: Como puedo hacer una lectura paralela de dos puertos...
Thanks for the translation! Gracias!
Re: I am using serial communication and always having error...
In LabVIEW versions up to 5.1, the VISA resource name for COM1 on a PC is ASRL1::INSTR, for COM2 ASRL2::INSTR etc. I believe LabVIEW 6 and later allow you to use the COM names as aliases but I'm a late adopter ;-) In any case I believe the ASRL notation should still work (someone else can probably help here). However, if you say your program communicates OK to start with then the resource name you are using is correct. If you're seeing the error you mentioned after some time, I wonder if you are opening lots of VISA sessions but not closing them again, so eventually VISA runs out of resources? Generally you should open a VISA session in your program before you start communicating, wire that session through all the VISA VI's you use, and only close the session when your program finishes. If you're seeing some other intermittent error such as a timeout, consider timing issues - maybe your instrument sometimes takes slightly longer to respond, or you try to read data while the instrument is only half-way through sending it, etc. You may need to think about how to make your program more robust against these problems.
Re: Como puedo hacer una lectura paralela de dos puertos...
If I understand correctly, you want to read from two serial ports where the data arrives at different rates? Just use separate, independent loops to read from each port. Use queues to send the data from each loop to where it is needed, which could be another VI or a third loop in the same VI.
Re: Does Labview 7 Express support ICP DAS make DAQ board?
Drivers and manuals for ICP-DAS products, including LabVIEW software, are available here: http://www.icpdas.com/download/ Have you tried their VI's and if so do they work?
Re: Questions about MKS instruments by using RS-232.
I'm not familiar with those instruments, but I've controlled MKS mass flow controllers via RS-485 from LabVIEW and found it straightforward. I think there were some VI's from MKS that used the old serial functions, but I decided to write my own driver using VISA. As long as you have the manual for the command protocol from MKS you should have no problem. If there's a setup or utility program from MKS for these instruments, use that first to verify communication and to check that the instrument settings such as serial baud rate are correct. As for the RS-232 ports, you'll need to add extra ports using either a card or a USB adapter - both are fairly cheap and widely available. Many PC's now have only one RS-232 port, so check how many you need to add.
Re: sir i want to synchronize 3 vi's using occurence fn but i am not getting how to use occurences
I've found notifiers (or queues) easier to understand and use than occurrences. When one VI changes a value, have it also send a notification. The other VI's use Wait on Notifier which will wait until it receives the notification. In fact, you may be able to do away with variables altogether and just use the notifiers themselves to hold your data.