Jump to content

aledain

Members
  • Posts

    113
  • Joined

  • Last visited

    Never

Everything posted by aledain

  1. Remember too, that programmatic saving of control defaults does not work in a built application.
  2. If you're using the IAK file, then the IP address is embedded in there. By opening the IAK file (with the FPOpen VI (or if you leave it unwired it uses the last opened IAK file on your computer)), you gain access to the fieldpoint values. To access values you need to set the correct tags to read. If you read the "all" tag then you might not get what you expect. Also look at the error cluster, if there's an error the default value might be returned.
  3. I cannot see your code (not all of us have 7.1) but if I understand your question corectly you might be using the wrong tool. The reason excel doesn't like the "bits" is that they are non printable characters. Each character received in a string like this represents a byte (8 bits) that can be interpreted as an ASCII character (0..255), some of which are the characters A, a, 1, etc, but many which are non printable. You can convert tthe string you receive into bytes using the (A) tool in figure below, alternatively you may want to see the ascii "hex" representation of the string (B). What I think you need to do is "decode" the array of bytes into the numbers, then write the numbers as a string to file ©. cheers, Alex.
  4. However this does not take into account the considerable time outside the current project that the integrator has spent developing re-usable libraries, gathering expertise, etc. I believe source code should be onsold to cover these "hidden" business costs which are not necessarily covered in a per hourly development rate by the integrator. Such costs include (but is not limited to): time spent researching programming structures, training costs, office costs, project management (if not included in the hourly rate), backup procedures, in-house company expertise in THEIR program (and it's requirements), documentation procedures, travel, computer hardware updating, and experience with hardware. The fact that greater experience leads to decreased risk for customer is another aspect not appreciated (or paid for) by the client. Also I believe that integration work often involves out of scope expertise (especially in measurement/science) and that this process is creative. Creative processes should yield higher payment than simple technical prowess. Let's look at an example. If I charge $1K per day to develop a simple application it may take me 3-5 days. Another (less experienced programmer) might take 5-10days, but charge the same amount per day. Aside from the likelihood of completing the job faster (and winning the job in the first place), the customer saves $5k by going with me, rather than the less experienced guy. But shouldn't I be leveraging my experience in some fashion? Giving aeay source code would seem to be counter productive in this sense. I pefer to argue the business case about releasing the source code, how much will the client save over the long term by having better more maintainable code? Such a creative effort that yields a positive ROI for the client should be rewarded. If it's a test system, why not ask for a per unit payment for each test watch the reaction! Some systems I have written have saved companies literally thousands of dollars per annum, and never has that effort been back rewarded to the integrator. Certain clients still baulk at paying an hour or two at $A120 for systems that cost $100k to develop, and make $1000's per year. I would argue that a good charge for software might be 20% per year as a percentage of the total cost of development. This is not unreasonable as you do not sell the source code, you are selling a license to use said code (it is your intellectual property after all) for a period up to 5 years. After that time the source code can either revert to the integrator or the client (your choice). I would argue this along the lines that after 5 years the OS, hardware, platform, comapny will/may have changed and there will be little need for the original source code anyway. Perhaps we should consider other sorts of publishing, if an author writes a book (programmer creates a program), many people are allowed to read the book (use the software) but the author retains the copyright to the work. If you copyright your software, shouldn't you be the only one allowed to "change" it?
  5. I think that the DIO on the 6023 (being low cost) isn't as configurable as those on the special DIO cards (ie for HW buffering) so I don't think the DIO Occurrences will work. If you did have access to one of those cards (eg DIO-24, DIO-96) you can do what amounts to a continuous buffered acquisition on the digital lines and examine the buffers returned for your events. IOW, the DI is clocked/sampled at the rate you want. However, could you use the 6023's counter? I don't have one to play with but I think you should be able to make the counter a 'countdown' type which will generate an occurrence (or similar) when it reaches zero (alternatively a 'countup' and it reaches 1). I haven't done this in a long time so I cannot remember all the details. This can be certainly be done on the CTR cards, and will probably depend on the counter on the 6023. On the CTR cards we used the CTR to count down a number of pulses generated by an encoder on a pump, setting another line high when the counts were complete (to (a) switch a relay to turn the pump off, and (b) notify the software that the task was done). These lines are GATE and SOURCE from memory and I worked this out from the counter examples. Another thought, there is a frequency estimator (counter) example that might work too.
  6. Don't know how the event structure improves the following because I don't have access to >6.1 at the moment ... When I originally was after this sort of thing I was using it to create a ?simple? text editor and the highlighting was for the FIND method. It works nicely (apart from a brief flash as the text is highlighted). Now is it possible to extend this to give me real time <cough> syntax highlighting? By that I mean as I type 'word' and word is in my list of defined text strings to be green, it gets coloured green. I reckon this could be done with the text select and highlight method outlined before, but it might be pretty ugly (flash, flash, etc), especially when loading and parsing a file for syntax highlighting at startup. Does anyone have any better ideas?
  7. Another good alternative is to purchase a copy of VMware. This is a virtual machine that allows multiple copies of OS to be files on your hard disk. Install each 'clients' combination of drivers on a separate virtual machine. Even better, ghost your clients machine and run virtual on your desktop.
  8. Correct.You can still autoscale by twiddling the autoscale property programmatically so the user can probably enable and disable autoscale to trigger an autoscale. Instead you might need to monitor min/max over the chart yourself and set the max/min as needed. BTW even though it reads EnableAutoScales it supposedly applies to that annoying resize problem. Unfortunately I cannot suggest anything else other than a workaround if it doesn't work. Workaround: add your own markers instead of the labview ones. You can still use the ticks and position them at the middle, top and bottom of the graph axis. If you make the arbitrary markers have sufficient white space, perhaps this will force the graph to be stable (ie probably use a fixed width font) even when the style changes. Please see the LabVIEW FAQ.
  9. Use the search and replace tool (String Palette). Wire "\n" as search and leave the replace unwired (it will replace with a NULL string). Wire the TRUE if you want to replace all the \n's.
  10. If its a 2D array, then expand the index array tool as shown attached.
  11. The timeout means that you are reading the VISA buffer and there is no data present. If the message is CRLF terminated, then you might be missing packets because your program loop time does not service the VISA buffer at fast enough intervals. Although VISA does tend to store multiple messages for you. Alternately you are seeing a timeout because you are looping too fast; but as you believe you're missing data I would guess too slow or that the serial device is a different type (see below). You neeed to determine which type of device you have. Serial devices fall into three broad categories (or modes): sender only, sender receiver, and lossless. 1. Sender Only. This is where the device spits data down the serial line at you. You need to know how often this happens (interval) and if it is relatively infrequent, ignore the timeout because it only means that you have not received a packet for a "while". If the packet fails to arrive in 2-3 x interval it can safely be assumed that your device is not communicating with you any more. 2. Sender Receiver. This is where the controller (usually the PC) has to send a command to the device and then wait for the data to be returned. For example GETDATA is sent and -76.34 is received. In this case, make sure your VISA timeout has been set > 2 times the expected response time. The response time will include the instrument response time plus the time it takes for the data to be physically sent across the serial cable. This is an issues if the baud rate is low < 9600 and/or the amount of data sent back is large (in bytes). 3. Lossless. This is where ACK commands are sent between devices. When a message is sent between a controller and slave device (which might be the PC), an ACK needs to be sent to tell the controller that the packet was received and decoded correctly. If the ACK is not sent then the controller usually resends the packet and waits for the ACK; usually three times before the controller reports an error. More robust industrial serial protocols (eg MODBUS) can use this communication mode, but some other instruments use complicated protocols like this, eg Mettler Titrators. Note: Some devices can switch between these modes by sending a command to the device or in certain phases of their normal action.
  12. A textbox scrollbar is enabled using a string indicator and RMB>VisibleItems>Scrollbar. Note that the string indicator needs to be >2 lines in height for the Scrollbar option to be accessible. Creating buffers is most easily done using a global variable. Place a string indicator in a global and read, append and write to the global with the arrival of each new set of data. [You could also use an array of strings if you want to store the data as messages]. The efficiency of this can be upped a little bit using a preallocated string array. Note that this method runs the risk of race conditions if you write to the global from multiple locations in your program. Instead I recommend a LV2 global, as discussed below. Creating buffers is most efficiently done using a LV2 style global variable (aka functional global, aka shift register global; for an explaination see LV2 Globals). Create the string as either an single string, an array of strings or a preallocated array of strings stored in you rshift register. Add "method" calls to add or view your data. The link above provides a simple example. One other alternative is to use a GOOP object to store your data. cheers, Alex.
  13. There is no splash screen popup in a built exe! You shouldn't be seeing any LabVIEW popup at all. Are you perhaps opening a Vi from within an LLB? When using a built exe there are several ways in which to make a splash screen appear, the most popular being to use a splash vi as the top level vi and use VI server to load all the Vi's for your application.
  14. Include the following line in your labview.ini file or built application ini file: EnableAutoScales=False
  15. aledain

    certification

    Perhaps a peer vote/poll on a gang of three (four) to be top level in the first instance. These incumbents then review and add new certified members at the various levels. By default we could assume that "top level certified" means they are by default also reviewers. Alternatively we could propose that once several top level members are available, that a review board is elected by the top level members from amongst the available top level members. Levels By various levels we could envisage a system whereby you could apply for an open evaluation (the board chooses which level you are "graded" at). Alternatively you could apply to become a lowest level member and once a lowest level member you can be reviewed at a later date to progress to higher levels. (Proposed) Levels Might Be: Novice: <1 year full time or equivalent, no code review. Journeyman: 1-3 years full time OR small app reviewed (+30 VI's) OR ... Master: 3-6 years full time OR large app reviewed (+100 VI's) OR ... GrandMaster: 6+ years full time OR very large app reviewed (+300 VI's) OR ... Other Considerations We'd also have to allow for certification where source code could not be evaluated for privacy reasons. Also need some sort of Non-Disclosure Agreement for the reviewd code. Along with this we might insist that all GrandMasters/ReviewBoard must have all business relationships declared at a level such that a person seeking certification is not imparting knowledge to a business associate that they do not wish to divulge such information. We'd also might consider incorporating the NI certification equivalent at an appropraite level. We'd also might consider an alternate "testing" process for those who want/need to prove their prowess ... but this might not even have to be part of certification at all. We'd also might consider that to become a GrandMaster, you might need support from at least one (or N) other GrandMasters (ie a sponsored application), as a further level of peer recognition. We'd probably need a professional charter of "standards" that our certification process recognises for members at each level. This would aid prospective employers in what they can expect from a "certified" developer. We'd probably need some disclaimer to avoid being sued :headbang: in this litigious world of ours, if the information were to be used by a prospective employer.
  16. aledain

    certification

    Unfortunately my mind turns away from the idea of sitting any sort of exam ((+++ years at uni ;-)). For some professional organisations, peer recognition works just as well, if not better than exam certification. I agree with Michael that being a CLD would not be the sole requirement for a position as a programmer or LabVIEW developer, it would limit the field unnecessarily. However, I would hazard a guess that there are many talented programmers who have neither the time or money to become CLD'ed, but might benefit from community recognition. So if i may propose a peer certification program, perhaps LAVA "sponsored" where a review panel could award recognition. It could have different levels (journeyman (1-3 yrs, master (4-6 years), grandmaster (7+ years), etc). Recognition could be based on review of work, review of commitment to the LabVIEW community, time immersed in wiring, or other areas that the review panel could think of. Recognition would be free and based somewhat on the scientific research principal. Any other thoughts, or is this too big a task?
  17. Aah I remember now, STI was the one I got to work under LV too. It worked quite nicely. I would suggest checking out George's tools as well because his stuff is always top shelf.
  18. I may have missed the point of what you're trying to achieve here, but in my experience you're trying to place to much in the UI. The UI should be left for just that, the user. It should not be asked for values so it should solely waiting for user input (in an ideal world ;-)). However rather than go into more complicated structures, I suggest you check out the preview Q element node. That way you do not need to remove the element and re-queue it. If the element is not for you leave it alone, when one does arrive addressed to you remove it and add any response (if necessary) to the end of the queue. In the long run, research on OOP techniques in LabVIEW, this is a much better design philosophy for transferring data across loops (without race conditions), IMHO. As it happens I use OOP coupled with the architecture you are creating (queue driven state machine) to great effect in just about every application I write. OOP or GOOP as it's called in LabVIEW will also solve your problem of multiple readers requiring the same data, simply read the object data in each loop.
  19. From the web: callback - A scheme used in event-driven programs where the program registers a subroutine (a "callback handler") to handle a certain event. The program does not call the handler directly but when the event occurs, the run-time system calls the handler, usually passing it arguments to describe the event. Okay, so that means that a callback is really registration of a link to a handler with a system/process? Is there more to it than that? From your server example it would seem that the server is the main vi (run-time system) and the that callback handler is the "handler" vi? But in this case there is not registration as such as the server contains both the registration and the system to handle the registration. Have I got that right? IOW in your TCPIP server example the server would seem to be both the engine and the register-er of the callback? Correct or am I just being plain dumb
  20. I have noted with interest Jim Kring's referral to usding callbacks in his code on several different topics. I have used callbacks (I think) with LV occurrences to signal arrival of hardware messages in IO queues and for DLL's written in C communicating with the SCSI bus. However I am not convinced that callbacks are always a good solution. I once had an interesting discussion (read argument) with a "programmer" <see rant> who suggested solving a problem via a callback simply because the operation could take a long, indeterminate period of time (in actual fact this time was only 1-2 seconds!). I argued that in LabVIEW, create a separate fibre (ie a "loop" within a thread ) and just wait for the process to complete! Having recently been exposed to the Teststand GUI that is written in ActiveX with callbacks linked to buttons I think the callback can obfuscate the code especially from an understanding point of view. The only reason I can think for a callback is the freeing up of the current process so that the user can "abort" and the code is not "locked" inside a DLL/process/function node. Are there others? Given LV lends itself to dataflow and IMHO callbacks "break" that dataflow paradigm, what are the advantages of callbacks? Perhaps someone can point out when and where they should be used or discouraged. And more importantanly perhaps add some pointers on creating/using callbacks in LV. cheers, Alex. <rant>I could have throttled that programmer as I think he was ultimately responsible for us not getting the project. I use the term programmer loosely because a university student in physics should not be advising companies on how to build professional, maintainable, code. If he'd at least studied com. sci. or prog. eng. as an undergraduate I could have yeilded to the argument. But to not know LabVIEW, been programming for less than 6 months, and believe that "callbacks" were the answer to a database query poblem is just ... grrrrr .... Guess I am learning that being right does not mean successful.</rant>
  21. The spacing (position) of charcters within a string is dependent on the font selected. If you use a fixed width font then the lining up of the columns will be fine (as you are no doubt aware). Fonts and LV suck big time anyway so unfortunately I think this might be a big wish! Note, you can use the number to string functions and pass the "width" of the formatted output just as if you were in a text based language too. As you say, you can use a multicolumn box and if you use the "classic" controls it is relatively easy to hide all the decals.
  22. I did get this to also work with an ActiveX component downloaded from the net. I cannot remember the name of the one I used <chagrin> but a quick google reveraled a fair few and some of them appeared to be free.
  23. And *cough* potentially illegal ...
  24. Thanks Didier, I thought that it looked suspiciously like expected behaviour (from what I recall of CompSci). Still I think that when you're got a wire (bearing in mind that wire could be many miles long ;-)) when you test for length it should return 0 if it "knows" there is no physical data inside the array. LV itself knows this because the array indicator is greyed, whereas a traditional language might not have that, LV itself recognises the no data! cheers, Alex.
  25. I guess it might be true that having customisable controls may seem to limit labview but I believe most of what you have requested has already been handled by others without these features. From personal experience I have just started devolving NI's teststand ActiveX controls and cannot get the $&*(%^*(& stuff to create reports; their "button" (itself an ActriveX control) seems to limit me from gaining any insight into how the code should be constructed to make it work. Callbacks - yuk!!! <gripe> This is supposed to be dataflow!! </gripe> I shudder to think of the mess if dropping a control on your FP added code that you didn't know about ;-) "having code behind your control" - open a reference to your control, pass that reference to a subvi - as much code as you can ever want or handle can happen within the subvi. "possibility to create events on the control" is this not available from 6.1 onwards. From 7 onwards you can create your won events and link these to a control via a reference and subvi as noted above. "redirect standard events of the control to modify its behaviour" available from 6.1 or have I missed something? "possibilities to combine controls" combine controls with the customise control option from the menu. There is a great article in LTR on creating complicated controls from the standard LV ones. I have also seen lovely coloured graphic equaliser looking controls created with the standard labview controls customised appropraitely. "to disable/extend context menu on controls" also in LTR, there is an article on creating your own context menus. Perhaps not as good as the real thing but it only took me an hour to write my own from scratch having read this article and it works really great.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.