Jump to content

Mellroth

Members
  • Posts

    602
  • Joined

  • Last visited

  • Days Won

    16

Posts posted by Mellroth

  1. Anyway assuming you can find a way to get a VI reference to the Clipboard VI, you could then intercept the Paste menu event and the Paste Data popup menu event and modify the strings that are about to be pasted on the clipboard VI before allowing the Paste to occur.

    The ability to intercept Copy-Paste operations would be a nice addition to the event structure, but I don't think it would completely solve the issue here.

    We would still face problems when a user selects a portion of the string, and then enters new characters (possibly by copy-paste or drag-n-drop).

    I made a little VI, that checks the key-down event and also the Value change event. When illegal characters are detected it just opens a dialog.

    Download File:post-5958-1167215079.vi

    /J

  2. Try this...

    Popup on the string control and turn on "Update value while typing." This will generate a Value Changed event after every keystroke.

    Then have an event structure that watches for value changed on the string. Any time the event fires, check the last character of "new value" of the string. If the character is illegal, then wire "old value" into the string's value property.

    There might be other ways involving keyboard events, but I'm not familiar enough with the options.

    This works fine as long as the user only enters data by typing them. But if the user copy-pasted data that contained illegal characters this might not work.

    To make it work, you would have to check the complete string everytime the event fires.

    A similar approach would be to monitor key-strokes while the control is in edit-mode, and add an event check when value changed...

    /J

  3. Hope you can help me to find what I'm doing wrong, please see the small attached vi. I'm just trying to convert spreadsheet string to an array of numbers with 1 digit precision but I don't know what I'm doing wrong, I think the format string input is o.k but I'm at this point I'm doubting of everything :wacko: .

    Hi,

    I think your problem is that you are using the wrong decimal point.

    Try the formatting string "%.;%f" instead. This willl force LabVIEW to use a period as decimal character.

    In my opinion it is good practice to always specify the decimal character explicitly, since different computers can have different settings.

    There is also no need to tell LabVIEW to only read 1 decimal, since it is only a matter of display.

    /J

  4. Maybe this little VI can get you started, it auto-indexes the input array and adds matches to the pre-allocated array.

    Download File:post-5958-1166185718.vi

    /J

    My vi has a 2D array input, also the output. The first position of every row inside the 2D input array is a string, which I have to parse. In case there was a match with an string constant value I have to keep this row into 2D output array and going on the rest of the rows.
  5. Alright, so I have a timed sequence that turns a boolean off, and then on, repeatedly, by an amount of time set by the user. I am also writing to a DAQmx device. When I monitor the line with an oscilloscope and both times set to 2ms, everything is fine. When I set them both to 0ms, it seems to stay high for about 130us, and then low for about the same, which is fine.

    Hi,

    Just a thought, if it is accurate timing on the digital line you want, why don't you use a counter output?

    Search the LabVIEW examples for the counter/timer examples, try one of the "Gen Dig Pulse..." VIs.

    /J

  6. The time delta numeric indicator displays a constant value.

    Hi,

    the reason you get time delta = 0.001, is that the sampling frequency is set to 1kHz in the "Simulate Signal" node. The time between sampled points will therefore be 0.001s.

    If you want to measure the period of the generated signal, look in the "Waveform measurements" palette, there you will find express VIs that measure the period/frequency/duty cycle/etc..

    /J

  7. Sorry ! My english is not good . We just want to simulate error performance analyzer. Now , we have bought NI USB-6009.

    But we don't know how to do.So, Need your help!

    Can you explain in more detail what you want to do, e.g.

    * Do you intend to do the BER check in real time, or on recorded data?

    * What is the source of the data to be checked?

    * What is the data speed?

    * What have you tried so far? Can you show us some code?

    /J

  8. Then a grey triangle appears on the input of the VI used (see attached file below)

    The grey dot is a "coercion dot", this indicates that LabVIEW has to convert representation of the input.

    In your case I can only guess that you are mixing different integer representations (I8, I16, I32 etc.).

    To avoid this, make sure all inputs of the "build array" are using the same representation.

    /J

  9. I have no idea. What does the documentation say?

    Thanks anyway.

    Documentation does not explicitly state that it is possible.

    The reason I asked was that I got the impression that you were really familiar with the conditional disable structures (maybe even reponsible :) ), so I thought that perhaps you knew a way to get the available symbols.

    /J

  10. Thanks JFM for tell me your experience about telnet protocol. Related to your answer, I also thought that maybe an "exit" command was a must but after implementting it the execution behaviour is still the same...

    Did you add "newline" after "exit"? And did you check if the server responded to the exit command?

    Other than that I am out of ideas, and I don't have InternetToolkit installed at the moment so I have to install that to continue searching...

    /J

  11. ...when I try to run it again I have to wait some time, from 30 seconds to 1 min before running it again...

    Hi,

    I have experienced something smilar, not with the internet toolkit, but with a custom made TELNET client.

    In that case the problem was that the TELNET server expected the client to send "bye" or "exit" before closing the connection.

    The timeout (30-60s) was for the server to realize that the client had disconnected.

    So a possible solution could be to send the command "bye" or "exit", before you actually disconnect.

    /J

  12. The "code disable" structure is for multi-platform loading. "I want this to be enabled on Platform XYZ, and that to be enabled on Platform PDQ".

    Just as a side note; if you use this strucure in a RT project, and you have a VI used on all targets but with different code (through a code disable structure) for Windows/RT/cRIO.

    When you deploy to a target, you will probably have to save the VI again, since the target symbol has changed from previous run.

    If you are running your VI from your SourceControl system directly, this means that you will have to check out/hijack the VI in order to be able to run it on all platforms.

    Sometimes I wish that there was a way to tell LabVIEW to keep code for all targets...

    /J

  13. i want to show images on second monitor programatically while my program GUI is on first monitor

    By using a property node on the application reference, you can find out the pixel boundaries for both your monitors.

    The primary monitor is found in "Display->Primary Workspace", and to get the bounds for the other monitors (including primary) use "Display->All Monitors"

    Then open a VI reference to the VI that you want to re-position, and set the bounds for your VI using the properties found in the "FrontPanelWindow" subpalette.

    I don't remember if it is PanelBounds or WindowBounds, and I don't have access to LV at the moment to check, you will just have to try.

    Notice that you will have to set all properties (left, right, top, bottom) in order to move the window, otherwise you will just resize the panel.

    /J

  14. New unprotected version above... ;)

    I was just too tired...

    The reason you only get 10 updates per second in your file is that 10 samples takes 100ms to get (assuming 100Hz sample rate).

    Then you only update the file once for all these 10 samples, i.e. 10 times per second.

    Maybe you are treating all 10 samples as one, instread of 10? I don't know why you use the "Convert To Dynamic data" node, when you could act on the 2D array of doubles directly.

    /J

  15. It is supplied on the frontpanel (why this method Johan)

    Ooops, need to put on my glasses :wacko:

    Now in continious mode the number of samples means almost nothing, it is used for setting the buffer size (see DAQmx help).

    Every run 10 samples are written.

    If you initialize DAQmx beforehand (setting buffers, mode etc.), and then call DAQmx read with # of samples specifed. Then I belive that DAQmx read will wait until the buffer contains the requested number of samples or until timeout.

    The DAQmx read VI is set to read 10 samples at each loop iteration. The task is set to sample in continuous mode with a rate of 100 Hz and samples to read is set to 100. This do result in that 10 samples/sec in log file (it is sufficient for now). But why doesn't 100 samples get written to the log file?

    I actually don't see where you specified the acquisition mode, rate, buffer size etc (MAX?).

    You really should start the task before entering the acquisition loop.

    The reason why the upper loop has to be finished before entering the lower loop, is that the "Stop Program" wire, is going out of the upper loop and into the lower loop, and this actually means that the event structures will only be read once (as you noticed). Instead read the "Stop Program" button in an Event structure, and remove the wire going from the upper to the lower loop. As Ton said, only use one event structure for all your events.

    /J

  16. ...I have removed the timed loop, and local variables....

    The DAQmx read VI is set to read 10 samples at each loop iteration. The task is set to sample in continuous mode with a rate of 100 Hz and samples to read is set to 100. This do result in that 10 samples/sec in log file (it is sufficient for now). But why doesn't 100 samples get written to the log file?...

    The attachment is password protected :blink:

    /J

  17. Hi All,

    I have figured it out. See the pics :P

    Well done :thumbup:

    I'm sorry I haven't replyed to your last posts, but my knowledge regarding the Fantom SDK is NIL :blink:

    By the looks of your program, I think you should add error handling in the loops, maybe break loop execution upon an error?

    There is also no visible delay in the upper loop, and this together with the lack of error handling can get you into trouble.

    /J

×
×
  • Create New...

Important Information

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