Jump to content

Mark Yedinak

Members
  • Posts

    429
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mark Yedinak

  1. Here is a slightly different version which would solve his original issue of converting a number with greater than 32 bits on an earlier version of LabVIEW that did not have U64 integers. This vi will take an arbitrarily long decimal string and convert it to a hexadecimal string.
  2. QUOTE (nicolasB @ Feb 19 2009, 04:02 PM) I agree. I am completely in the dark about what you are trying to do therefore I can't even begin to suggest a solution for you. With that said if you are trying to process your data in parallel you could use a queue or a notifier to pass the data from one task (the For loop) to another task (draw your graph). That essentially is the basic method for passing data out of a loop to be processed by another task.
  3. You will have to decode the body of the message. Most email application use MIME encoding. You will need to decode the MIME encoded data and extract the content of the attachment from that. Here are two examples (the separators "----- Label ----" are not part of the POP3 data.) of a message both with the same content however one was sent as plain text and the other as an attachment. --------Plain Text Message ---------- Received: from 10.3.4.98 ([10.3.4.98]) by 03ctctestexch.ctc-zebra.test with Microsoft SMTPSVC(6.0.3790.1830); Thu, 19 Feb 2009 14:21:16 -0600 To: lab_tester@ctc-zebra.test From: fubar@blegga.com Subject: Test (Send as plain text) Return-Path: fubar@blegga.com Message-ID: <03CTCTESTEXCH8wSA1X00000004@03ctctestexch.ctc-zebra.test> X-OriginalArrivalTime: 19 Feb 2009 20:21:16.0898 (UTC) FILETIME=[9E544C20:01C992CF] Date: 19 Feb 2009 14:21:16 -0600 ^xa ^fo0, 0^a0,,20^fdUnderachievement -- The tallest blade of grass is the first to be cut by the lawnmower.^fs ^HCN ^xz . ------- End of message --------- ------- Attached data ---------- Received: from 10.3.4.98 ([10.3.4.98]) by 03ctctestexch.ctc-zebra.test with Microsoft SMTPSVC(6.0.3790.1830); Thu, 19 Feb 2009 14:21:16 -0600 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="LabVIEW_SMTP_MIME_Boundary" Content-Transfer-Encoding: 7bit To: lab_tester@ctc-zebra.test From: fubar@blegga.com Subject: Test (Send as file attachment) Date: Thu, 19 Feb 2009 14:21:22 -0600 Return-Path: fubar@blegga.com Message-ID: <03CTCTESTEXCHFRaqbC00000003@03ctctestexch.ctc-zebra.test> X-OriginalArrivalTime: 19 Feb 2009 20:21:16.0528 (UTC) FILETIME=[9E1BD700:01C992CF] --LabVIEW_SMTP_MIME_Boundary Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable --LabVIEW_SMTP_MIME_Boundary Content-Type: text/plain; name="supersmall.zpl"; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="supersmall.zpl" ^xa ^fo0, 0^a0,,20^fdUnderachievement -- The tallest blade of grass is the f= irst to be cut by the lawnmower.^fs ^HCN ^xz --LabVIEW_SMTP_MIME_Boundary-- . ------- End of message --------- I have also include the libraries that I use for POP3 messaging. I found these on the internet several years ago.
  4. QUOTE (jdunham @ Feb 19 2009, 11:17 AM) This was my thought as well. By doing this method you could read the list of fixtures from a file or a database and populate the list box with the appropriate data. You could also have different connection types for your fixtures if needed. Internally you have an array of clusters with all the necessary data. You could then pass the individual cluster of the desired fixture to whatever needs it.
  5. QUOTE (Ton @ Feb 17 2009, 03:39 PM) This will work nicely provided he has 64 bit integers. Based on an earlier post of his he needed to do this on without 64 bit integers for numbers larger than 32 bit integers. That was the reason I was suggesting converting the string to a byte array and processing that. That solution will work for abitrarily large numbers.
  6. I am in a very similar situation as Val. For teh majority of time that I have been using LabVIEW I have been on the SSP. I also use the developer suite which includes the database connection toolkit. I like to have the official support behind the toolkit and for me this would justify getting the license if it wasn't already included with the developer's suite.
  7. Use the same general approach that I used in the example I posted in your other thread but modify the algorithm. In this case you would only be working with a single array and you would need to work with two elements of the array at one time. You would also need to work with nibbles of data. Cycle through the array picking 16 bits of data at a time from the digits and then accumulate the new hex string. In this conversion you would not need to generate the intermediate byte array as you could go directly to the hexadecimal string.
  8. Here is a simple example for adding two large numbers. It should give you a good idea of how to proceed. If you will be doing more operations with larger numbers, or large number of numbers then you may need to spend some time optimizing the code for efficiency.
  9. You should be careful changing the IP address of your PC programmatically. Is you are not careful this can cause you lots of networking headaches. If you are on an isolated, controlled and self contained network you could do this. If you are running on a large network, such as your company's network, I recommend you contact your IT staff regarding your IP addressing needs. Network addresses are managed for a reason. The last thing you want to do is create duplicate addresses on a network.
  10. Without using a different data type such as a double then your only real option is to handle 64 bit integers yourself. You would have to do this by using two 32 bit integers and creating your own methods for operating on those values. this would be a non-trivial exercise but if you must have them in integer format this is one of your only real alternatives. Much more memory intensive but possibly easier to work with and more extensible would be to store each digit of the number as an element of a byte array. Again, you have to create your own methods for operating on the numbers but they would be fairly straight forward to implement. Think back to your early days of learning math.
  11. QUOTE (Kubo @ Feb 13 2009, 03:12 PM) Actually this functionality is part of your state machine. I am not sure how you implemented yours but I prefer to use queues for my state events. The state machine runs parallel to the while loop containing the event structure. The event structure handles my user interface events and can start or stop the state machine. The state machine itself contains the logic regarding the sequence of your processing as well as handling when certain things should occur or waiting for a specific data input. For instance, once started your state machine could initialize your hardware, then send some data followed by a wait for a response from the hardware. Once the response is read it would then go to the next step in the process. I suggest you include an error state and a general delay state in your state machine. That wait you could set a timeout value for your response and process the error in an appropriate manner. At the moment I don't have an example of a simple queued state machine. I am sure others might be able to provide one. If not I could probably put something together if you needed it.
  12. First I would recommend a more robust architecture for your application. It would benefit from a state machine as well as parallel tasks using queues or notifies to pass messages. With that said you need to read the serial port and compare the messages read using the various string functions. You could use regular expressions or more basic comparisons. Without any details on the types and format of the messages your device sends it is difficult to make anything more than very basic suggestions. Also, it is not necessary to reconfigure your Visa connection every loop iteration. This should really only be done once outside the loop. The loop should only be reading the serial port and taking the correct action when it sees the desired message.I also have to ask if you really want to read both ports within the same loop. Would your application be more robust and flexible if each port was handled individually or are they truly related to each other?
  13. QUOTE (Aristos Queue @ Feb 11 2009, 09:37 PM) Thanks. VB is one language that I haven't played with.
  14. I think the answer is more fundamental then that. What you need to do is validate your input prior to execution. In your example you would need to capture the start event (using an event structure is one possibility), then validate all of your input. If the input is valid start the execution. If not, display a message using a simple dialog box and return to waiting for the start message again.
  15. What type if var Comport? I suspect that this is not simply an integer. This may be part of your problem.
  16. QUOTE (ejensen @ Feb 10 2009, 03:46 PM) I think you just did his homework.
  17. On a somewhat related topic do you know if it is possible for a subVI to inherit the background color of the calling VI? In my environment we reuse a large amount of our code and we have many general purpose VIs that are dialog boxes. Because we reuse our code I would like these dialog boxes to inherit the colors from the calling VI. The brute force method would be to get a reference to the calling VI and get it's color information and then set the colors for the subVI. This however may result in a flicker of the display (or we have to delay showing the FP until the colors are set). It would seem that an attribute allowing teh colors to be inherited would be convenient and useful. Is there such a thing?
  18. QUOTE (mesmith @ Feb 5 2009, 03:50 PM) Congrats! I took my exam at the end of last year and was notified last month that I passed. Now onto the CLA exam.
  19. QUOTE (mesmith @ Feb 5 2009, 01:00 PM) You might be write but I can't imagine anyone creating a networked device that isn't intended to sit on a real network. My entire professional career has been in the network world and the thought of duplicate IP addresses makes me cringe. You may be right and this is intended to be the equivalent of a hard wire replacement but I don't see the logic in anyone doing this. The beauty of a network is that you can place equipment anywhere and be able to communicate with it. Once you are on the network you should play by the rules. Anyway, that is the network guy in me talking.
  20. QUOTE (Phillip Brooks @ Feb 5 2009, 12:49 PM) This is a GUI application which needs to be able to be run from the command line. Essentially this is a tool that can be used by a person sitting down and interacting with it or it can be invoked automatically and run in a non-interactive mode. Since we need command lines arguments to support this functionality I would line to be able to print an error message back out to the command prompt if the command line arguments are incorrect. I suppose I could display a dialog box with the error message but it seems to be much more straightforward to simply print the message out to the command line.
  21. QUOTE (OlivierL @ Feb 5 2009, 11:45 AM) This is useful information but it is still a very bad idea to give the same IP address to all of the clients. This can cause some major problems on your network. Duplicate IP address can lead to routers and switches on the network having bad routes and can create data loops and circular routes within the network. Worst case this can bring a network down. If the IP addresses of these clients can be seen by network I would strongly recommend against using duplicate IP addresses. From a network perspective you are asking for trouble.
  22. How can I write data back out to standard out from a built application? I have a stand-alone executable that takes command line arguments and I want to be able to write an error message back out to standard out if the command line arguments are invalid. How can this be done?
  23. QUOTE (GraemeJ @ Feb 4 2009, 06:21 PM) Within the single event structure you simply create event cases for each control or evnet you are interested in processing. This can be extended by using user events in addition to the standard events (value change, mouse up, mouse down, etc.).
  24. I generally use a single event structure for all of my user interface control. I use queues to communicate with the individual while loops which actually do the work. Remember, once you begin processing inside a case of an event structure no other event can be serviced until that one completes. Using multiple event structures complicates the control of your user interface and creates situations that you are seeing. A good practice is to have very minimal processing inside an event structure. Capture the event and trigger some other process (another while loop waiting on a queue or notifier) and then return to waiting for events. Off load your processing to separate parallel tasks rather than perform the processing inside of the event structure itself.
  25. If I understand you correctly you are saying that you have four devices connected to the network each having the same IP address. If this is the case this is an illegal network configuration and it will cause you problems. IP addresses must be unique on a network. If my understanding is incorrect than please clarify so that I can provide a better informed answer.
×
×
  • Create New...

Important Information

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