Re: Analysis Support files
OK, but if you do not want to install the whole run-time engine (e.g. to avoid having files in Program Files\National Instruments, which our users would not recognise as something they need and may delete) you could previously get away with having the run-time files in the same folder as your executable. Is that now impossible? It would *very* be nice if NI made it easier to build custom installers that include all necessary files; and that place support files somewhere less accessible to the user and not labeled LabVIEW, National Instruments, VISA etc...(I haven't checked it in LV7.1 yet, but LV7 insists on creating a LabVIEW Data folder as well, overrunning it in the application ini-file does not work...). The installer builder use merge files (which one includes the analysis support?) and those files could be used in installers made in other software, however they are not documented to make that easy...And as far as I can see they have so many dependancies that one would have to include all the .msm files.
Re: Analysis Support files
Another things is that the RTE for LV7.1 is huge. The way we included files in LV7 we could build installers with the necessary RTE support that we could e-mail (3-5 MB)...
LV7.1 installer replaces .ini file
After upgrading to LV7.1 it seems impossible to get away from usig the application builder's installer (if you want support for analysis VIs), terrible enough, however the installer seems to replace the .ini file I include as well. If I distribute hello.exe I normally include a hello.ini file with a number of keys in it (hiderootwindow e.g.), however the LV installer seems to create it's own hello.ini which only contains the application section ([hello]) and nothing else. There must be a way to avoid this.
Re: LV7.1 installer replaces .ini file
Perhaps that's the problem; I did not add it as a support file in the build of the app, but as a file in the files section of the installer setup (should still work, but maybe there is a minor bug there...). Mads
Analysis Support files
We normally build our install sets with a third party tool and to avoid having NI's name anywhere we include all files in that set. With LV7.1 it's no longer enough to just have the lvanlys.dll included if you use any of the analysis functions though - and the question is; do we really have to build the installer in the application builder and check the include support for analysis VIs under advanced to get this to work...or could we just include some additional dlls etc.?
Re: How do I use a sub VI to read/write to objects on the calling VI's front panel?
Give the sub-VI references to the controls and indicators. In the sub-VI you wire the reference inputs to property node(s) and write to the value property. You can obtain the references manually by right-clicking on the control/indicator and create the reference, or you can do it dynamically by using the controls property of the front panel, filter out the ones you need e.g. by name and then send the remaining array of refs to the sub-VI. Using value properties is not ideal though (execute in the user interface thread etc). Another solution is to make a global (I always use functional globals instead) and make the main VI read the global(s) after the sub-VI has run and set the control and indicator values. The solutions above are only necessary if the defaults change and you will build an application of the VIs / want the value saved outside the VI. Otherwise you can just use an invoke node to reset all or individual control and indicators to default, and you can make new values default and save the VI with those...
Re: More doubts on: non reentrancy for TCP/IP VIs
The server part is OK. I see the session handler opens a database, my guess is there is something there that prevents parallell replies. If you strip down the session handler to just reply with a string generated in the handler; are things still not able to run side by side? If it's not could you post the stripped handler?
Re: More doubts on: non reentrancy for TCP/IP VIs
How exactly do you spawn request handlers? Do you call a reentrant handler VI dynamically with the run method? It's possible to have multiple connection handlers that handle requests in parallell, I do that in several of my client-server applications. All clients connect to the same port, that's not the problem. There must be something in the architecture you have that prevents this from working; is there e.g. a reply generator that may halt the other handlers when it's busy with the request from another handler?
Re: 2 way TCP connection using IP addresses
On the client side the users will need to fill in the IP address or domain of the server. If that IP is on the Internet or somewhere else that will work as long as the client PC has physical access and permission to open a tcp connection (no firewalls that block the port you are using etc.) Make a connect dialog that pops up if the user chooses to connect and have the user input the IP there and click OK. You can add functionality like bookmarks and home page to make things easier. If a home page / server is defined the client can connect to that upon startup. You may want also to add functionality that will reconnect in the background if the connection is lost. The client's IP is of less interest. If you need it though just use the string to IP function and the IP to string function from the tcp/ip palette. Do not wire anything to the former funtion but wire it's output to the latter. The latter will then output the IP of the local PC.
Re: Data transmission
Why do you convert the sgl to an integer string and then to a U8 and then type cast that to a string which you send? All you need is to flatten it to a string (once) and if you want to keep the precision you cannot convert it to a U8. If you have an SGL and want to read that SGL across a serial link type cast the SGL to a string (just wire it to the type cast function, it defaults to a string), wire that string to the serial write...and then when you read it make sure you get all the bytes (4) and then wire that string to a type cast with an SGL as the specified type. By just type casting you are sending the data as a binary string. Unless you have some reason for adding overhead there is no need to make it a readable string.
Re: What happened if i check the property called Reentrant in SubVI's?
Yes, you can pretty much multiply the memory footprint of the reentrant VI with the number of instances you have. In other words having 50 instances of a 300K VI will cost you quite a bit of memory...if the VI is smaller it's not that much a worry though.
Re: How do I read text from specific rows and columns in a tree structure?
You need to set two properties to activate the correct cell and then you can read it's string property. The positioning properties are the ActiveItemTag and ActiveColNum properties. With them you select the tree item by it's tag and the active column. The string can then be read from the Cell String property.
Re: Notifiers
Yes, that's how they are normally used. You can pass the notifier reference via wire or global, or obtain it by name in each VI.
Re: how do i show a 1D array on an xy graph?
No need for an XY graph in this case; just wire the array to a graph and if you want to zoom in on something programmatically you can control the min and max, scaling and pretty much everything else using a property node (just right-click on the graph, select create property node and then click on it to select which property to set, you can expand it to read/write multiple properties with the same node, or create multiple property nodes. The Y axis will by default just show the array index number unless you set the X0 and delta X properties.
Easier way to edit tree items?
If you want to change the child text of an item without rebuidling the tree it seems you must do this cell by cell (set active tag, set active column, write cell text), is that correct? (I expected it to be possible to just specify the child tag and it's new child text array, like when you add the item. Doing it cell by cell seems very inefficient.)
Re: How to keep alignment in Windows LARGE and SMALL fonts
Getting the panels to look just as good no matter what font and font size the user choose is close to impossible. As you say NI does not look like they have payed it much attention either; even the startup menu of LV get's cluttered if the font size or type is wrong. The best option if you want to optimize things for all resolutions without having different VIs is probably to not use the application font. Use a specific font and size and design everything to function relatively well on both low and high resolution (in other words; a bit too big on low, a bit small on high...). By setting the default font to something else in the LV options you can avoid having to change the font during development. Personally I use the application fonts, but fix the font and font size using the appFont,dialogFont and systemFont keys in the .ini file of the applications. The following keys in the .ini file e.g. will fix the font to Tahoma at size 13: appFont=Tahoma 13 dialogFont=Tahoma 13 systemFont=Tahoma 13
Re: How to keep alignment in Windows LARGE and SMALL fonts
Well, I'm not blaming NI for all bad things in the world...However I do think people expect a better workaround than the one NI has chosen in LV7. As it is now it's much too easy to end up with LV menus completely unusable. As Greg indicates in his answer as well; ignoring the font choice and sticking to the small fonts would e.g. be better.
Re: how to clear table on button click
In short, because the table is a control, you'll need to use a local and write an empty string array to it. The button should be latched (right click on it on the front panel and select mechanical action-latched until released) and wired to a case. Right click on the table on the diagramme and select create local. Place the local inside the true case. Right click on the local and select create constant, and wire that constant to the local. If the clear operation needs to be done at a specific time (you want to read the table just prior to reading the button click e.g.) make sure the data flow ensures this.
Re: How do you write to a 3D array?
3D array handling is not much different from 2D, you just have another coordinate to specify - page (row, column, page). Create a 3D array constant and wire it to e.g. the replace function and it will automatically scale up to show you the index and length options involved... PS. If you have XY arrays why not just have a 1D array of XY sets (as one would use for multiplot XY graphs)?You could even write the whole array to a graph (save you the extraction operations) and then choose to see whatever combination you would like by setting the color of the plots you want to hide to transparent.
Re: tab control manipulation
Just create a local of the tab control and write the index of the page you want to that local.
Re: VI Slow Down/performance
Normally introducing a sub-VI is trouble-free and as you say it's better to arrange the code that way. If the code is to be called repeatedly (thousands of times) and it all needs to finish as fast as possible the accumulated overhead introduced can get significant and you must skip the sub-VI. (I actually suggested to NI two days ago to add a feature in LV where you can organize the code in a sub-VI and set it to flatten when compiled (or a new type of object) only for organization purposes and then have the compiler flatten the code to optimize performance). When it comes to memory usage the story is a bit more complicated. If you do not have the front panel in memory that will prevent some copies from being made, however even with the front panel removed / not in memory the sub-VI may introduce data copies. If the data amount is large (which is perhaps the case here?) this can be costly. Normally that would not give much of a performance penalty though - but if the amount of memory available is too small and the software must use virtual memory (disk) you can quickly get a significant performance drop. Could lack of memory be an issue here? If not, could you post the caller and sub-VI?
Re: VI Slow Down/performance
I could not notice any speed difference. If the one without sub-VI is set to full speed then yes the one with sub-VI will slow down because the other one is taking all the CPU time, however that works the other way around too (if you set the sub-VI type to full speed first).
Re: Wlile loop that takes all the CPU time
This is true only if you use the Wait until next ms Multiple, the Wait function on the other hand will always give the CPU it's rest...
Re: Wlile loop that takes all the CPU time
It's kind of in the middle;-) As Rolf says if there is other code that takes all the CPU then sure, the wait included in another code does not help...But for the code that the wait is involved in it will allways ensure a halt, contrary to the wait until next ms which would immediately let everything run if the target ms has been reached already. If you could post a picture of the code or the code itself I'm sure we can find a solution/explanation.
Re: Time format in LV7
Store the time zone in the file as well and so when your application opens it in Prague you calculate what time offset you need to apply to the DBL and calculate the Sydney time. Check out the following thread: http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101RPAGEID=135HOID=5065000800A684UCATEGORY_0=_49_%24_6_UCATEGORY_S=0USEARCHCONTEXT_TIER_0=0USEARCHCONTEXT_TIER_S=0USEARCHCONTEXT_QUESTION_0=UTCUSEARCHCONTEXT_QUESTION_S=0
Re: I want to build an array using the data that I get through the serial port
Not sure exactly why you want to do this but you can keep the previously read data in a shift register and concatinate it with the new data as it arrives. This can become costly (memory and speed-wise) if you read a lot of data and concatinate frequently. If you can avoid reading the data until it has all arrived (the serial port has a buffer...) that is a better solution.
Re: How do I programmatically set the label text on graphics with multiple scales?
You need to set the active Y scale (just expand the property node and make the other one the active Y scale property. If you have a sorted array of names just wire it into a for loop with the property node iside and the Y scale wired to the index of the loop.
Re: Some Fundamental Knowledge on TCP
(i) Yes, same with LV. (ii) You'll need to do a read. The read has a timeout input so you can do a 0 second timeout if you want.
Re: tabbing order in tab controls
Right-click on the tab and select Reorder controls In page from the menu that pops up.
Re: How do you avoid local variables?
In LV the wire is the variable. The controls and indicators are not supposed to be that much involved; they are there for GUI purposes and are used to send data to and from sub-VIs. Not much more. If you need the data many different places wire it there. The indicator can only show one result anyway so there is no need to wire anything else than the final result to it. If e.g. you need to store a previous result use shift registers, do not write it to the indicator just to read it back. Sure, sometimes locals can be useful in LV, but they are not to be used as in written languages. Especially avoid locals of large data sets; that's where the biggest penalty is. Get used to avoiding locals and it will contribute to much better G code.
Re: Clearing a local variable after each read
In such a case I would skip the indicator and local and use either a que or a functional global to receive the output from the TCP function. If the TCP reads separate messages the que would be my first choice. If it just read the data as it is I would use a functional global to hold the traffic and add multiple methods to it. The reason why you use an indicator at all e.g. I assume is because sometimes you want to see the traffic. Instead of having an indicator in the reading VI though I would have a read method in the func.global that lets you read out the traffic to display it wherever you need it.
Re: I have two number which representation is binary(8 digits...
Wire the two numbers to the Join Numbers function found on the Advanced-Data Manipluation palette. Then wire that number to the Number to boolean function. If the numbers are strings you can simply concatinate the strings and then type-cast it to an integer which you send to the number to boolean function.
Re: Defining SubVI!
The functions palette has a choice called select VI...(icon looks like a VI icon inside a dialog bubble) choose that and browse to the VI you want to insert as a sub-VI. If you use a function frequently you can put it in the user.lib directory and it will automatically show in the user lib subpalette of the functions palette. If you want it to be a separate button somewhere else edit the menu by selecting Edit Palette Views from the Tools-Advanced menu.
Re: Data type Everything
Use variants. If you want to see how this is done download the OpenG toolkit (www.openg.org) and have a look. Most of it's VIs are polymorphic and will use the correct type if it's available in the VI set, however for all other types it will use the variant based one.
Re: Reusing previous values!
The most common and probably safest is to use uninitialized shift registers to hold the previous data. This technique is frequently used e.g. to create functional globals.
Re: Hola!!!Yesterday, I asked a question about serial port...
You write your command to the port, then immediately check the bytes at port and read those. Now since the time delay between these two operations are 0 no bytes have yet arrived at the port and so the read function is asked to read 0 bytes... If you know how many bytes the reply will consist of do not check the bytes at port but wire that number of bytes to the read, it will then wait up to 20 seconds (if I recall the VISA behaviour correct) for that number of bytes to be available. OR continously check the number of bytes and do a read when it reports the correct number of bytes (then you can make your own timeout...). If the reply has a termination character VISA can be set up to return when it has received that.If you do not know the length of the reply nor have a termination character to rely on you can define a rpely timeout and an interbyte time limit, check the number of bytes every interbyte time and if the bytes starts to come in but there is a halt longer than the defined limit you assume the whole reply has arrived and do the read...
Re: Are there any write or read commands for the USB port in...
If the unit has a driver in the form of a dll you use a code library function node to call that dll. You can find lot's of information and examples on calling dlls in LV. If there is an activeX driver there's activeX functions you can use to call that. (If nobody else has made a wrapper-VI for the driver before consider sharing it with others if you make one...:-)) Sometimes USB units come with a driver that when installed transparently presents the unit as soemthing more familiar e.g. a standard COMport. In those cases you can use the standard ways to communicate with such a unit; in the mentioned case the serial VIs (old or VISA-based) will work fine.
Re: RS 485
RS485 is used by thousands of different units. Normally it will look just like a standard serial port to the application and you can use the serial VIs to communicate. The scan for device, acknowledge etc. that you describe is not part of the RS485 standard, it must be something specific for the device you have. What type of device are we talking about?
Re: Viewing processor utilization within the application?
If you have LV7 and have installed the .Net framework there is an example included with LV called SimpleTaskMonitor.vi, it does just that - using .Net
Re: Clearing a local variable after each read
Clearing a local is the same as writing an empty string to the indicator (or another local of it in write mode). Use data flow (may need the help of a single-frame sequence e.g.) to ensure that you have read the local before you write an empty string using another local... If you have an indicator there must be a value going to it, most likely from a wire. Why do you use a local to read the value of the indicator instead of wiring the value to whereever you need it?
Re: Timestamped charts with variable numbers of plots
XY-graphs do not have an in-built buffer the way charts do (there is no XY-chart) so you will have to hold the data in a buffer/buffers you make yourself. A circular buffer is a good option for this. Let's say that when adding an input you dynamically create a circular buffer for it and you also make a functional global that administers the buffers (keeps a list of the signals available and which circular VI that holds it's data, in this case the timestamp X and the signal value Y). Now you can let the user see that list and select which ones to show on the XY graph. Every now and then you read that selection list. Wire the selection list to a for loop e.g. with autoindexing and inside it you call the circular buffers holding the data. You bundle the X and Y (or do it inside the buffer) and wire it out of the for loop...now you have an array of XY plots ready to be wired into the XY graph...refresh at a rate high enough to give a real time impression for the user.
Re: ValueChanged event programmatically ?
The event is only triggered by changes from the GUI. In LV7 the Value (Signaling) property was introduced though and if you use that it will generate an event.
Re: Time-Dependent Function
Nice to be of help. In LV5 you'll need to wire a boolean out of the case, as you can see in my LV7 code there is a tunnel there that doe snot have an input; it's because in LV7 you can specify the tunnel to return the default if it's not wired; in this case a false...
Re: Why timer anomalies in event structure?
Here's my first take on this: Unlike other events the timeout event will not que up and it will restart it's counting when another event has happened. The time value will be the time it is handled, not the time it went into the que as with other events. So let's say that there was a timeout at 10:00:00:000. After 300 ms you press the wait 200 ms button. The event returns at 10:00:00:500. Now the timeout starts running again and after 1000 ms it fires and is handled. Now however it's 10:00:01:500, and you calculate a delta t of 1500 seconds. This way the maximum delta t can become 2*Timeout+Wait time. If this is true I have some code that needs adjustment myself to work 100% correct; code that expects the timeout to enter the que and be handled even if the event structure was busy when the timeout occured.
Detect/intercept windows shutdown
Has anyone made a function that detects and/or can intercept shutdown requests (this question has been raised here by others earlier, but no answer yet...)? I have an application that must be able to quit properly in such an event.
Re: User event
Yes you have to give the reference to the event to the other VI (by wire, functional global or other). Events are qued, you can't loose events - that's one of the advantages with ques.
Re: Splitting a Concatenated String??
If you have added a comment to the file and want to read it and separate it into different substrings later on you will need to include a separator in the comment you write. Otherwise there is no way the other functions will know how to unbundle it (since it's not bundled but concatinated...). The separator can be e.g. ., ;, CRLF, Tab or whatever suits you best. Then you'll need to have a function somewhere that splits the string into it's componants based on the separators.
Re: my labview library is taking up a lot of space
You may have saved the VI with the controls and indicators set with the 100K elements as default. In that case the arrays are saved in the VI and it wil take up a lot more space than the code would... Working with large arrays there are a number of pitfalls (most of which involve continously copying and resizing the large arrays using the build, insert, delete and other array functions that have to do that or locals and globals). The quickest way to know would be to post the work here, or an example (remember to upload all sub-VIs etc). You can also find lots of info on this if you check out the optimization part of the manual and run a search on that here.
Re: clear an array
Your are thinking about the 2D array in the shift register, right? If so then right click on the left shift register and create an empty 2D array and wire it into the shift register terminal from the outside of the loop. This will initialize the shift register. Uninitilized shift registers are nice to use when you want to keep in memory the results from previous changes, e.g. to use a VI with a loop as a global (check out functional globals), otherwise though you should initialize the shift registers.
Re: Does Labview allocate twice the memory for arrays passed to a subvi?
Yes. SubVIs keep their own copies. This is one of the reasons why rules like modulizing the code into sub-VIs are best not followed when you work with *really* large data sets; then it's best to keep the code as flat as possible. I think there has been a large thread here about this earlier where Greg McKaskle explained this in detail.
Re: Dialog color that matches tab in the XP theme too
Thanks Greg! The color I was looking for is 16777271, works as expected (the color picker just shows it as black though). Can we have more system colors on the palette next time...?:-)
Re: Dialog color that matches tab in the XP theme too
We used to do that ourselves; but at a point we decided that it looked better to follow the windows theme. It takes some time to ensure that it looks OK on the most common themes, but it makes things look more native for the users.
Re: Dialog color that matches tab in the XP theme too
I've overlooked the dialog label(!)...in this case we haven't used separate labels so the coloring Greg helped with was nice to get, but I'll use the dialog label in the future.
Dialog color that matches tab in the XP theme too
We use system colors and dialog control for pretty much all our GUIs, but we've run into a problem when using a system background color on text labels on tab controls: There seems to be no system color that will match the theme color of a dialog tab control... We use the text labels as names on dialog frames so we cannot use a transparent label, it must have a background color that matches the tab color. With the XP theme that color is a shade of white...so the Panel and object color does not match (it's a light shade of grey). With the classic theme the tab has the panel and object color allright, but the XP theme is different. Is there a system color we've overlooked, or?
Re: i am having a problem with while loops, i have two while...
Could you please define exactly what it is you want to get as an output and where you are to use that output? If you just terminate the inner loop the outer loop will iterate and thus restart the inner loop. The inner loop has it's conditions set to stop but that just means that it will run just one iteration...so now the outer loop runs continously, making the inner loop run one iteration each time. In this case you'll get multiple values out of the outer loop since it is running multiple iterations. If all you wanted was one value, the one from the last iteration of the inner loop the first time it was called you'll need to terminate the outer loop at the same time as the inner by wiring the stop of the inner to the conditional terminal of the outer as well. In short - try to figure out what you want and make sure the logic of the code really fits that... By the way; the use a a sequence is not necessary. If you want to clear the array prior to running the loop just wire the error output of the property node to the left border of the outer while loop, that way data flow ensures the right order of execution and the code becomes easier to read (sequences is normally avoided where data flow can be used instead, data flow should be the primary controller of execution you use when writing G). The use of a property node for this task is not the best option either (in this case you could use an invoke node to reset the default value instead anyway) - use locals for this (locals too are to be avoided though - if wiring can do the job).
Re: serial data simulation problem
The best is probably to make a simulation software and then use a null-modem cable and have your application talk to the simulator via a loop-back serial link...But making the simulator could be some work (if it's just a few commands to support it should be possible to make within an hour, but that depends on your experience). The second best is to have a VI that returns simulated data and then use that instead of the serial VIs when testing. That does not test things as thorough as the former method, but is probably quicker to implement.
Re: Communicating Between Built LV App.s
To get access to TCP/IP, UDP etc. on a PC without a network card you can install a virtual network card / loopback card. As far as I remember you can find it as an option if you try to add a network card in the add device panel... We've used this on some occasions to be able to use our tcp/ip based client/server solutions on PCs without a network card. To comment on the que thread: The OpenG Toolkit includes a remote que solution. I highly recommend it, you can find it on www.openg.org
Re: Communicating Between Built LV App.s
Which he will have available if he installs a loop-back card driver (comes standard from Microsoft)...
Re: Problem exchanging global values with an excutable vi
Globals are only global within one and the same executable, if you need two different applications to share a variable you'll need to set up a link between the two. You can use TCP/IP, DDE, a file or other ways to communicate between the two.
Re: Modbus communnication using labview???
If the communication you need is very simple, like e.g. just to get X modbus register values from the unit then opening a serial og tcp/ip link and sending a fixed string to the unit (assuming it's a slave...is it?) will do the trick. Then you'll get back a string that is fairly easy to decode into an array. I can make an example for you if you specify whether the unit is a slave or a master and what registers you want and do you need to read or write them? If you need to do more, buying a third party modbus library or building one yourself is the solution. Serial VIs or TCP/IP VIs will be at the bottom of the necessary code, but on top you need code to generate and decode modbus messages. If buying is the preferred way to go just try searching for modbus driver for LabVIEW on the net. I know you can find one at www.cardiac.no, but that only supports serial modbus as far as I know. If you want to get to know the protocol check out the documents available at www.modbus.org
Re: Problem with array processing !!!
It's due to the fact that you are displaying all those 100 000 values and updating them in the indicator on every iteration. If you move the indicator outside of the loop so that it will only be updated when the processing is finished things will run fast.
Re: saving and restoring,default controls values(LV7)
If you just need to save the values there are variant based tools for this included in the OpenG toolkit, you can find it on www.openg.org. If you want to save properties as well have a look at the Property Saver Toolkit at: http://www.kshif.com/lv/index.html
Re: closing front panels
Most often controlling the closing and opening of the panel is done from the VI properties - window appearance setup, there you can set whether the VIs front panel should open when called or loaded and whether it should close when finished. The same properties can be set/overrun when calling the VI in the sub-VI node setup which you can access by right-clicking on the sub-VI. However - you can also open and close front panels using property nodes or methods. If you get a reference to the VI and set it's front panel open property to false you close the window and vice versa. Using an invoke node there is a method called Open FP...lot's of options in other words. You'll need to make sure the data flow is correct though; it does not help to close a window if you really need the VI to stop and unload e.g. Closing the last open front panel by making all code end and then set the front panel open property to false is the cleanest way to exit a built application by the way; unlike using the quit function the last window will dissapear instantly, no flashing of a halted VI window (In my oppinion NI should modify this function so that it does not do this in built applications...but anyaway).
Re: automatically changing min and max values in a colour ramp while the VI is running
This is done using a property node. Right-click on the control and select create - property node. A property ndoe will pop up on the diagramme. Click on the property node and you can select what property to read or write. You can expand the node to include multiple property terminals. You'll find the properties you'll need in the sub-menu of the scale property.
Re: How can I set one loop's frequency as a slave of another loop ?
The occurence halts all execution until it is set, no CPU load.
Re: How can I detect if a global bolean variable has changed
I would use a functional global to store the boolean, or skip the boolean all together and just have the functional global store the time. The global should have read and write funtionality, and when you use the write method it should update the time... You mention events and events do not need to be local. You can create a user event and pass the reference to that event wherever you want. By putting it into a functional global e.g. you can have an event structure react to the event one place and have other parts of the code fire the event by using the reference from the global...not many limitations really.
Re: Why does a vi not release memory even when arrays have been emptied?
Sounds like there is a copy of the arrays that is never deleted...but it's not good to tell without the code. You could try stripping away parts of the code and see if there is a certain part that keeps the memory (try loading the VI dynamically and then unload it completely, do you see the same efect?). Sometimes you can have memory fragmentation that will prevent the memroy from being deallocated.
Re: tcp read / tcp write ?
No.
Re: when to consider giving different port number to every new client that is connecting to the server?
When the server receives requests from the clients, does it really reply in parallell, or does it handle the requests sequencially? If the latter, improve the performance by dynamically creating connection handlers that process requests from each client individually. Compression is another thing that may improve the performance.
Re: RS232 vs RS485
Need to be more specific; What is it that takes 600 ms with RS232 and 1200 ms with RS485?
Re: Split data into high byte and low byte
The reason is that the value sent to the split function is not a 16 bit number as it should be (to be splitted into two bytes), but an I32. It's the constant (50) that the angle is multiplied by that forces the type from U16 to I32, just change the type of that constant. LabVIEW tries to indicate all this to you by placing small grey coercien dots at the terminals. If you look there are lots of them, e.g. on the hi and low byte indicators, this shows that the output of the split is not a byte.
Re: Triggering an event with Value (signaling)
You register the control, but there is no event case that acts on that dynamic event...
Re: XY graphing
I assume that what you mean is that if you run the aquisition more than once you want to keep the samples from the previous runs on the graph...right? Like a chart but with XY functionality. In that case you will need to make a buffer, e.g. a functional global style rotating buffer (If you can decide on the maximum number of samples to hold in the buffer you can work on a preallocated array and save lots of memory and get much better speed so that would be preferable).
Re: How to convert the string to VISA resource name?
Check out this one: http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101RPAGEID=135HOID=5065000800943BUCATEGORY_0=_49_%24_6_UCATEGORY_S=0USEARCHCONTEXT_QUESTION_0=string+to+VISA+resource+nameUSEARCHCONTEXT_QUESTION_S=0
Re: Setting dialog in window Appearance makes program run very slow !!
It's unclear exactly what you have done different to make it run slower; have you always had that subVI there and called it, the only change being that it is set to dialog...or have you done other things too? Wehn you say things are slow - is it just that pop-up VI or does the whole machine slow down? Do you have a wait function in the dialog VI? If you did not have that dialog before and you have made it with a loop without a wait in it that will explain the slow behaviour. If you can speed things up just by chaning the window apperance though it's more difficult to see a reason. If you could post the sub-VI and the caller as a .llb file or as pictures we could take a closer look.
Re: Is there something to solve the problem of connecting two terminals of different types?
If you have 1-D array of XY-clusters and you want to extract all the X or Y values as a 1-D array just wire the cluster array to a for-loop with auto-indexing on, then wire the cluster element inside the loop to an unbundle function, and wire the element you want an array of out of the loop with auto-indexing on...the array you get from the loop can be given to the write to spreadsheet function. If you really want to write both the X and Y values the method is the same only you join the two values inside the for-loop to a row or column of the 2D array using the build array function, or have a 2D array predefined in a shift register and use the replace array element function. The write to spreadsheet function will then accept the 2D array. You need to make sure both the X and Y values are of the same type to get them into the same array though, if they are not - convert them using the convert functions from the numeric palette. I assume you are aware that there are waveform file IO functions as well so unless you need to save the data as text for other reasons you could feed the waveform to those instead.
Re: How do I run a program by using a control?
If it's a boolean you just put the VI inside a case and wire the boolean to the case selector... If it's another type of control e.g. a numeric you can either use an event structure and add a value change event case to it where you put the sub-VI or you can store the previous value in a shift register and check whether the current value differs from the previous one, if it does send the true to a case selector and have the sub-VI in the true case...
Re: XY Graph
If you have the data in a table all you need is to split the table into the X and Y parts (using the index array function) and then, if needed, convert the value to a numeric (the timestamp might e.g. need to be converted from a text string to number of seconds since...(?)). Now with one array of X values and one with Y values bundle the two arrays (X first, Y next) and feed it to the XY graph.
Re: Reverse of Format Date/Time String.VI
Very simple; just wire the string to a scan from string function and extract the month, day, year, hours, minutes and seconds as separate numbers. Now the date/time to seconds function takes a cluster of these numbers and converts it to a timestamp so all you need is to bundle the numbers into that cluster and give it to the date to seconds function.
Re: program ini
You assume correct... OpenG (www.openg.org) has a nice toolset to automate the build process by the way. Since Inno setup works on text scripts you can create an application that easily lets you do both things, and with an interface just the way you personally prefer it:-)
Re: Compare revision status of two large .llbs?
If you have the full development version of LV you can use the compare VI hierarchies function from the Tools- Compare menu. If not you could open the llb with the VI library manager (Tools menu) and check the show dates box you can see the dates of all the VIs.
Re: Can two subVI show up at the same time?
Yes as long as there is no data flow dependancies that stop one call (e.g. if sub-VI no.2 gets an input that is the output of the first one). You don't need to stop at 2 either, you can have multiple windows...as far as it's practical and user friendly.
Re: Dialog Box automatic field selection + Enter key OK button mapping.
Use a porperty node and write a true to the key focus property of the text control. If you need the OK button to react to an enter just right click on it, select advanced and key navigation and set the shortcut to enter. Instead of using a dialog box to retrive the keyboard input though I would just read the keyboard input directly, e.g. using the key down event. Create a shift register to hold the previous keys and add new keys every time that event fires. If the character is a CR process the bar code and clear the shift register.
Re: Can we create front pannel's references programatically ?
Unless you create a reference manually from the control the only way to get the reference is to use the front panel controls property AFAIK, however - extracting the reference to a specific control from that array is easy. If you know the index just wire the array to an index array function and give it that index...if you only know the label of the control read the label.text property of the references, search for the index of the name...and wire that index to an index array function with the control references array as input - voila, you have the specific reference you needed. The retrieval of the reference array and the name array may be effective to only do once and then keep them in shift registers. If you make a functional global that take a name as input and give out the reference; you can access them globally. Add a VI name to the search input and you can have the functional global serve references the controls of multiple panels.
Re: Repeatively extract certain number
What exactly is it you want to calculate an average from? You say you want to average the first 10 and then the next 10...which sound OK, then it's just creating an averaged graph, but you also say that in between the averages there are 6 values you don't want. Are you saying that you want the average of the first 10, then the average of values 16-25..then 32-41 etc..? As soon as I know exactly what data you want to use for the averaging and how you want the result presented I can make it for you.
Re: How can I design this subVI's connector?
If you right-click on the VI's icon in the top right corner and select patterns you can select a connector pattern that has more terminals. The maximum is 28. If you ever need more than 28 the solution is to use clusters and arrays.
Re: How can I design this subVI's connector?
You can also adapt it exactly to the number of terminals you need; if you have 16 and just want one extra just right-click on the pattern (where you assign terminals) and choose to add a terminal.
Re: How can I design this subVI's connector?
You do not need to use them all, just select a pattern that has more than 17 and wire up the ones you need.
Re: Repeatively extract certain number
If all you need to do is to calculate the average of a segment of the array just wire the array to the array subset function and specify the start and length of the subset you want. Wire the output to the average function (or a sum-function and then divide by the length). If the arrays are very large using the subset function might require a lot of memory, in that case use the index array element in a loop with a shift register and add the elements you want in the loop (keep the previous result in the shift reg), then divide the output by the number of elements. The latter procedure works also nicely if you need the average of elements separated from eachother in the array.
Re: memory is full on built application
Too general to really tell. There's probably something in the application that gets an invalid input when it is built, causing the thing to crash...Do you read a file, open a dll, port etc, create an array...Look for things that if given the wrong input might run amok... Try to put different parts of the application in case structures that you can control from e.g. an ini file or exclude them from the application and see if you can locate what part of the code that cause the problem. If possible upload the code here (or pictures of the most central parts) and we can have a look.
Re: Triggering events in LabVIEW 7.0
One solution is to change the value of the boolean by using the value(signaling) property. Unlike e.g. changing the value using a local this will trigger an event (events like this only trigger when there has been a user interface activity, that's why using a local won't work). The other solution is to add your own user defined event and then set that event prior to doing anything else in the application. Check out the user event examples to see how you create and trigger such events.
Re: multible plots on xy-graph?
There are two ways to do it. You can bundle an array of X values with the array of Y values and then build an array of such clusters, OR you can bundle the X and Y values so that you have an array of XY clusters and bundle the whole array to get a cluster with that array and then build an array of the different clusters(puh...) You can find an example if you search for XY in the find example function; the XY graph.vi
Re: Compare 2 string's - output boolean
This is where LV's polymorph functions make things very simple: just wire the strings into an Equal? function (from the comparison palette), if they are equal the output will be a boolean true.
Re: How can I import a large .wav file into LabVIEW for analysis?
The file read functions have a count and an offset input. Just tell it where to start in the file (offset) and how many elements of the given data type you want. Read the block, analyze it and then read another portion of the file. If you want to start where the previous read stopped just wire the offset output of the first read into the offset of the next one.