Jump to content

GregFreeman

Members
  • Posts

    323
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by GregFreeman

  1. You guys were right, but luckily there's the int->pointer function in .NET which allows you to get away from the CLFN rather quickly after making the initial call (at least in the case of grabbing icons from a dll).
  2. I am trying to open shell32.dll with .NET but an exception is being thrown. I'm seeing this type of exception all over when I search google but really not much related to LabVIEW (mostly vb.net, c#.net etc). I have tried loading shell32.dll from system32/shell32.dll and SysWOW64/shell32.dll and both fail. I am running 32 bit LabVIEW on Windows 7 64 bit. I'm guessing it has something to do with that. I am going to try on a coworkers 32 bit computer when I get a chance, but does anyone have suggestions? Thanks. Edit: Tried on 32 bit labview on a 32 bit machine and it still fails.
  3. I have a multicolumn listbox where I would like a "right-click" to set the value of the MC listbox to the row that was right-clicked, then a shortcut menu will appear. Depending on the value of the MC listbox (i.e. row clicked) I determine what right-click menu options are available. To do this, I use the mouse down event, and if it's a right click, I set the MC listbox value to the row clicked. Then, the shortcut menu activation event is fired, and in there I use the current value of the MC listbox to enable/disable menu items. My question is this, can I always expect the mouse down event to occur first (it seems it does), or do I need to manage the order in which the events fire. I guess I could also handle all this logic in the mouse down case, inside my case structure, when checking which button was pressed. What I want to make sure I avoid is the shortcut menu activation firing first and having the wrong row selected in the MC listbox which may disable/enable the wrong menu items. Edit: After discussing w/ co-workers, I think the answer is yes, because the mouse-down is the event, the shortcut menu activation is the system response to that event. Please let me know if this is wrong.
  4. Thanks for your response. I think I will take the groups approach for each time an exceedance happens because I agree that does make more sense to the end user. Unfortunately it is not exactly as straight forward as just "log when above, don't when not" there are some other conditions like "while exceeding the limit, log x seconds worth of data every x seconds" so there will be time gaps even if the threshold is crossed once and stays above the limit for an extended period of time. I believe I can handle these gaps progammatically with properties, by appending the waveforms in the TDMS file, but writing this time gap and number of samples-per-write as properties. Then when creating a custom viewer, using these properties to split the data back out and put "filler data" of 0's in between, where the gaps were. This keeps the log file smaller, but visually will make sense when displayed to the user.
  5. I have a TDMS file where I would like to log waveform data. But, I am only logging when certain conditions are met. This could result in some condition being met, then the condition going away, then coming back etc. For example, if I want to log when the RPM exceeds a value, I will start on this exceedance. But, maybe RPM drops back below a threshold so I stop logging. Now the RPM comes above the exceedance again, but if I log my waveform to the same channel, it doesn't account for this new t0. Does anyone have any thoughts on work arounds for this? I could make a "timestamp" channel and extrapolate out the timestamps from t0 and dt, but then I need a timestamp channel associated with each DAQ channel. I could have a channel of t0's where a property is the channel it's associated with and the start index of that data from within that channel, but all this is quite in depth. I have also thought about just making a new group or channel for each exceedance, but this could be confusing to the user if using the TDMS viewer. Is there a simpler way?
  6. Edit: it is saying no file selected for upload. I may not be able to attach it from work, unless someone else has a solution for this. If this is the case, I will have to attach it later. Could someone please save this back? It's a decent amount of files so if not it's not a big deal. I'm just trying to look at it for expansion of my LabVIEW knowledge . Also, I thought there was a board either on this forum or LAVA dedicated solely to saving back versions but I couldn't find it. If someone knows and can point me to it, I'd appreciate it for future reference. Thanks!
  7. One issue, I'm using 8.5 Sorry, I haven't set up my signature yet.
  8. Thanks for your response. Just one more question. Do you mean raise an error in the child class? How would you test the input wire type in the parent class? Wouldn't you want LabVIEW to delegate which child method to call and if it gets called then set the error there?
  9. This is the actual project I'm working on and somewhat relates to my last post in this forum. In my event structure, there are broken wires. I understand why but I was wondering the best way to go about fixing this. What my code is doing is reading an ini file and populating an array of amplifier classes (each type of amp has its own class) that inherits from the base class amplifier. I want to be able to take this array of sub classes that all inherit from my base class and wire it up to functions such as operate, standby, reset etc. However, most of those methods are only methods of one specific class type, and don't relate to all classes. Will I still need to make the functions polymorphic (dynamic dispatch) and initially define them in my base class even though they don't relate to all sub classes? This is for the situation of being able to index the array and wire the class elements to different methods. Sorry that's a bit wordy, hopefully seeing my VI's will help the question make more sense so I've attached them. I'm thinking I will have to put the methods in the base class and make them dynamic dispatch and for the amplifiers that they don't apply, just leave them blank but I wanted to see if there were other options. If clarrification is needed let me know. As always, any other comments are also appreciated. Thanks.
  10. For me, the array was being filled with empty strings. Did the array populate with the private data strings for you? AH rookie mistake. I have to set the string first. Duh.
  11. I posted this on NI forums but I figured I'd post it here since LAVA as a specific OOP section. \ Just teaching myself some OOP because I want to implement (no pun) it on my next project. However, I can't for the life of me figure out why the attached wont call the child methods.
  12. QUOTE (peteski @ May 22 2009, 04:15 PM) However, back to the most important point...setting a wait for next ms multiple to 5000 ms is not a good way to control how often you take data, as it will cause you a considerable wait time when trying to stop the program . I learned this the hard way in the first program i did when i wanted to take data every 120 seconds lol
  13. QUOTE (peteski @ May 22 2009, 02:38 PM) Haha, the funny thing is I posted this on the NI forums as an example of rube goldberg and got the same response! How could i have known, im only 22 lol.
  14. QUOTE (xShadowDanx @ May 12 2009, 09:39 AM) I haven't looked at your VI, I don't have Labview on here. However, using a wait doesn't seem like a good way to do this. If you want to stop your program and you press stop, you may have to wait up to 5 seconds for your program to end. Why not use a elapsed timer.vi and wire the time has elapsed booleanto a case structure. Inside the true case put all your data taking proceedures. QUOTE (Tim_S @ May 8 2009, 01:46 PM) You can wire a control that contains the milliseconds to delay to the Wait primitive. You could also have a control that has seconds (which more operators understand) and then multiply by 1000 to get milliseconds. Tim I got your code open. I have attached a simple example of how you can take data every 5 seconds. I would say though that there is some bad code in yours. Why do you have error, wired to a not, wired to continue while true? Why not just wire the error status to a stop if true? Rube Goldberg code. Also, how are you stopping your program? Does it just run until there is an error? You should wire a stop control and the error to an OR then wire that result to the stop sign of the while loop. It looks like you are using the abort on the front panel to stop which is a no-no. Anyways, here you go using an xy graph. Little messy but you should get the idea. You can change the 5 constant to a control to change how often the data is taken. If you want to write to a file you would also put that in the true case.
  15. QUOTE (labviewnoob @ May 20 2009, 02:20 AM) In order to be helped in a more detailed way, you will probably need to give more details . Do you want to select a range of data? Do you want to select numbers from a specific column, row, or column and row? Is your array 1D or 2D etc? All these things will help people answer your question.
  16. When you say start/stop/reset do you mean if you stop it its actually like a pause? Where if you hit start again it will start where it left off? Here is an example of using a timer to at least reset. I'm sure you can easily modify it to do the other things you need it to. Maybe I am misunderstanding your question but I think this is the simplest way to do it. If you need an example for a timer that can pause, look up the practice CLD exam for a car wash. Their timer in the solution has the ability to pause. Hope this helps. The left is a screenshot of the timer, the right is your program
  17. Thanks guys. It was pretty simple and I think I already understood it, I just wanted to double check that I wasn't leaving out some "coding standard" for VISA sessions
  18. In the past few months I have built Labview programs at my university and haven't used shift registers with my VISA wires when taking data in a while loop...the data was collected fine. I was wondering when its necessary to use them for VISA sessions, when/if its OK to sometimes not use them and why. Thanks in advance.
  19. GregFreeman

    misc

×
×
  • Create New...

Important Information

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