Jump to content

Aaron L

Members
  • Posts

    21
  • Joined

  • Last visited

Posts posted by Aaron L

  1. Could your device be interpreting 0x0 as its termination character?

    I'm using another computer running B&B Electronics ComTest as a surrogate receiver so I can see what bytes are coming across. The transmission stops at 0x00 and 0x00 isn't ever sent. I have another device that I can transmit a 0x00 null character and the PC running ComTest reads it perfectly as well as characters following 0x00.

    Attached is an image of the VI.

    post-4583-127084551292_thumb.jpg

  2. QUOTE (jdunham @ May 7 2009, 06:48 PM)

    It's true that there doesn't appear to be a good way to make it happen. Following that thought, I looked in the LV sample file Write Data to XML File.vi, and found there is a little trick NI uses. Placing a variable as the input to the Flatten to XML, the wire receives a name and that data is transmitted as a label in the XML file. You can see the attached. This works quite well for me since I have the file writes in a different location as the numeric input.

  3. I was trying to get a little XML data file going for a bit of data I need to save and wanted to use the built in labview tools. However, to create the name of a number, it comes from the wire label. See attached.

    I've right clicked on a wire and added the description, but that doesn't link into the XML data. The label has to end up in the location shown in the attachment, not in the area below as a description. How does one change the wire label? I just can't seem to find the correct word to search on how to do this.

    Thanks!

  4. QUOTE (crelf @ Jan 9 2009, 07:40 AM)

    Oh - okay. That makes it clearer.

    Yep - like others have said, you don't want to try to do the 20kHz clock in software, which is what you'd have to do with the USB DAQ modules you listed. You want to choose a device that has the clock generator as a chip on the device where you set the initial variables, start the generation, then just adjust the variable that you're interested in. Because you want to adjust it using a FP slider, then you're not trying to adjust it very quickly, so ned's right - the 6221 would work great.

    Thank you very much for the 6221 suggestion! I'll give NI a call and see what else is available. Working on a laptop does limit the options somewhat, like PCI cards and such, but it's good to see there is an USB alternative.

  5. QUOTE (crelf @ Jan 8 2009, 05:38 PM)

    Buy a stepper motor controller - they're gauranteed to output what you need, they're easy to control, and they'll work out of the box - lower your engineering anxiety and get the right tool for the job.

    I've got the electronics for the stepper controller, so I don't need to generate the sequencing. I really just need 2 digital IO lines for direction and hold. Any one of the DIO boxes above can do that for me. But the one thing I need is something that can generate a slowish (up to 20kHz) clock to activate the stepping. I'd like to control the clock speed with a slider, basic labview stuff, really. Will any of those actually do that?

  6. Hello,

    I am looking at purchasing one of the following:

    USB-6501

    USB-6008

    USB-6009

    for controlling a stepper motor. However, I cannot find the maximum digital output frequency of these units. The timing says software controlled. Can these output a pulse stream in the ~20kHz range? This is what I need to run the digital portion of my stepper motor controller. I would like to use labview to develop my ramp up/down times and see what works best for my application.

    Any help on this will be greatly appreciated. Thanks!

    Aaron

  7. QUOTE (LV_FPGA_SE @ Oct 17 2008, 09:15 AM)

    Aaron,

    I think the preferred method to solve this problem is that you edit your application to add a Run or Start button as part of the application. In other words the LV application does run immediately and waits for you to enter the parameters. Then when you are ready to execute, you press the new button on your UI which starts the main operation of your application. Once it completes the first operation, it goes back to the Wait state, waits for the new parameters, and you press the new Run button again. The actual LV application does not stop between these operations.

    Christian,

    Thank you for the idea! Unfortunately I didn't forsee this issue when I first began development. I believe I can see a way to do such a thing, now that you mention it.

    However, I have the pleasure of answering my own question as well. In the Build Menu, select Properties->Source file settings->Customize VI properties button -> Execution selection - > uncheck Run when opened. Hopefully this will help someone in the future.

    This will open the application but not begin running it. It's not the prefered method, but it achieves my current goals. I'll develop with a better LV methodology in the future, thanks!

  8. Hello,

    I need to have my EXE open when a user double-clicks the application, but I don't want the actual compiled VI to begin execution when opened. The user needs to enter several parameters prior to execution, like entering system serial numbers and such. Then, the user can hit the Run button and the program can run normally. This is only an issue on initially opening the application. Once the application is open, has run, and terminates normally, the user can change the parameters and run the application with Run again without issue.

    Is there a parameter I can set somewhere that will open the application but not run it? I don't know the right search term to figure out how to ask the question to find this parameter.

    Thanks!

  9. QUOTE (Neville D @ Sep 2 2008, 04:28 PM)

    Look at the Align and Resample Express VI.

    Neville,

    Thank you for the suggestion and direction. Attached is a VI I made using the Align and Resample function as well as just the Resample function. The VI contains both versions and show the difference. One thing I had to do was add one point to the end of the array to box in my endpoints. For whatever reason, the resample leaves off the last point.

    One thing I also had to do was make sure my original data point values showed up in the resampled waveform. This means only 2^(-n) sampling could be used. Fortunately, my resampling is 1/32, so I lucked out there.

    Hopefully this will be helpful to someone in the future for expanding arrays in labview using resampling.

  10. Hello,

    I'm attempting to take a 33 entry array, expand it to 1024 entries with the 33 original entries evenly spaced. Then, I need to linearly interpolate between each of those 33 spread-out entries and fill in the remaining 31 blank entries in between each original 33 now evenly spaced entries.

    I've found one example about using array expansion, but I have to do this operation many times, so I need to be more efficient about it. This is to fill up a lookup table (LUT).

    Ex:

    Take the original:

    1

    2

    3

    ...

    30

    31

    32

    And create the expanded:

    0

    (1/32 * (entry 0 - entry 1))

    (2/32 * (entry 0 - entry 1))

    ...

    (31/32 * (entry 0 - entry 1))

    1

    (1/32 * (entry 1 - entry 2))

    ...

    I can perform this expansion in a brute force method, but the Interpolate 1D Array VI suggests a much more effecient method that escapes me. There doesn't seem to be any good examples for the general operation of the Interpolate 1D Array VI to learn from. It appears to auto-index and take care of several operations at once, requiring a non-indexed entry into a FOR loop.

    Any guidance is greatly appreciated.

  11. Let's say I have two different while loops that I need to run. I want the numbers generated in while loop #1 to be shown on a waveform chart that updates during the loop. Then, when that loop is terminated, the code continues on via a flat sequence to another while loop, #2. I want to display the data from while loop #2 in the same waveform chart as while loop #1. Is this possible?

    My difficulty is I have 6 while loop sequences which need to execute sequentially. I only want to view the data in one waveform graph or chart that updates during each itteration of each sequentially executed while loop. Otherwise I have to have 6 waveform graphs to view the results for each while loops. I don't need to see the data in parallel since the operation is sequential anyway.

    Is this even possible since a chart doesn't seem to update unless it's inside a while loop?

  12. QUOTE (shoneill @ Mar 7 2008, 02:27 AM)

    The setting of the TermChar settings should be done only once immediately after you open a reference to the serial port. There's no need to call it in every loop. It might even have detrimental effects.

    Shane,

    Interestingly enough, when you take out the TermChar from the Instr, the system does not respond immediately, but waits for the time out period to happen from the VISA serial origination. I'm not sure why this happens. The setup still works, but the communication rate is limited to whatever the time out period is.

    Thanks!

    Aaron

  13. Here's the ultimate version that writes a command out, reads back the data:

    OK00, AAA45.678<CR><LF>

    And is immediately ready with another command. The VI ping pongs very well. The loop doesn't have to wait an arbitrary hold time, so it's ready as soon as the <LF> is received.

    Thanks all for your help and I hope this helps someone in the future.

  14. QUOTE(shoneill @ Mar 6 2008, 11:56 AM)

    @Dan

    Thanks for the reply. IIRC I never actually tried setting the TermChar and ASRLEndIn AND using events. That's probably my problem.

    @AAronL

    Set the number of Bytes to read to the maximum you should ever receive. I typically set it to double my maximum packet size. The reason is that the VISA read will terminate whenever the number of bytes was read OR the termination character is received, whichever comes first. So we remove the limitation of our Nr. of Bytes by telling it to read s silly amount of data. Then it will quit when it receives the LF Character. Of course, don't set the Nr of characters to read TOO high, otherwise you'll be risking locking up your program......

    Also, set the termchar options immediately after opening the port, before the wait. Otherwise it'll miss the first X events.

    This actually seems to be a downside of my approach. With user-controlled Buffering, blocked programs can be avoided nicely. Is there a way to trigger an event on the serial port? Preferebly without OS calls? I suppose a break might do it, huh?

    Shane.

    Shane,

    Great, that worked! Thank you. It's attached in this post so when people like myself need to find the solution to this problem, there are multiple available here. I'll go with this method for my application.

    Aaron

  15. QUOTE(shoneill @ Mar 6 2008, 04:30 AM)

    Why not just do this?

    http://lavag.org/old_files/monthly_03_2008/post-3076-1204806507.png' target="_blank">post-3076-1204806507.png?width=400

    "10" is the ASCII value for Linefeed.

    You can also set the termination condition seperately for both in and out directions (Bottom enums). These are found under the "Serial Settings" for the Serial Instr reference type. All others are found under "Message Based Settings".

    Shane

    Shane,

    I built up the code you suggested but the system still doesn't halt on a LF character, it only passes right through to the VISA read. Perhaps I'm missing something? I've attached a pic of the code and attached the code itself. I believe this is likely a more proper way to do this than event driven action, but I have yet to crack this one. Any suggestions?

  16. QUOTE(ASTDan @ Mar 6 2008, 08:19 AM)

    Dan,

    I was able to take your example and get it to work. This is the first code that seems to do what I want. I'll have to try it at full speed to see how it handles things. Attached is a VI with the basic program.

    Thanks!

  17. Okay, I just don't know the right search term to figure out what should be amazingly easy. :headbang:

    All I want to do is wait until I receive a CR/LF combo from a serial port, 9600/8/N/1, then execute the rest of my code. I looked at the example codes built into LV 8.5 to no avail. They have reads, simple and complex, but all of them time out rather than stopping on my CR/LF character combo. Really, all I need is the LF character. It can't be this difficult, right?

    I'm receiving a simple string from a photometer that ends in a CR/LF. I've tried setting the Enable termination, setting Status, but to no avail. I know what the length of the string is and have terminated on that, but if something goes wrong in the transmission, I don't want to get out of sync by just counting characters. It's important that I catch the LF character and halt on that, as this is a 6 hour operation. I can tollerate one bad message but the system can't tollerate getting out of synch.

    Thanks!

  18. A labview newbie here. LV 8 seems all powerful but being so makes it a monster to learn to do things. I've got my card outputting a single byte so I can manually trigger things. And I've also got MAX displaying that I can put a TTL signal into my system. So far, so good. Now things need to be a little more automated.

    Okay, I'm having some difficulty figuring out how to map the Ack/Input trigger pin into my labview project with an NI 6534 card. :headbang:

    The Pin 3 of the 68 pin connector seems to be grounded and not an input, not acting like a trigger input, so that's a confusing thing.

    I've found that I have to connect a PFI pin to the project but have just found out that PFI stands for Programmable Function Input. PFI does not occur in the entire NI-6534 user manual - I've looked.

    Basically, how do I trigger an event to fire off a pattern i/o on the 6534? I've read the data sheet extensively and being a rookie LV makes it difficult to jump from the Pattern I/O flow chart to something wired and programmed. I'm not looking for someone to do my work, only a nudge in the right direction.

    Regards,

    Aaron Linsdau

×
×
  • Create New...

Important Information

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