Jump to content

Michael Aivaliotis

Administrators
  • Posts

    6,217
  • Joined

  • Last visited

  • Days Won

    120

Posts posted by Michael Aivaliotis

  1. I'm not familiar with DAQmx and need some guidance to organize tasks settings with a PCI-6024E board.

    Analog inputs: 4 channels acquired once per second. Timing is not critical, I can use software timing. I don't need waveform

    Analog outputs: 2 channels. I need to update their values independently once in a while. No need for waveform generation.

    Digital input: I need to detect a home position so 10Hz read update rate is sufficient. I still can use software timing.

    Digital output: I need to activate a relay once in a while

    Counter inputs: I need to count edges on two counters inputs.

    While there are working examples for each task separately, I have to run all the above from different parts of the program. Do I need to define five tasks or can I regroup them in some way? Do digital input and output need to be on different port or can be on the same (e.g. are lines settable independently for I/O on the same port) ? Can the tasks conflict with each other, especially for timing requirement?<

    Thanks

    4282[/snapback]

    I can't answer all your questions since I've only been using DAQmx for a short while. This is what I've learned so far:

    You should configure all your individual channels as global channels first. Each global channel should be configured for each input sensor. Also, you should configure each digital IO line as a global channel. The global channel configuration defines the scaling and other parameters. Once this is done you then go and configure the required Tasks. Tasks define how you collect the data. You can create a single task that contains many global channels. In the task configuration you will define the aquisition speed and triggering etc. In you LabVIEW program you will use DAQmx task ID's not global channel id's.

    Hope this helps.

  2. Ah Louis,

    what I thought may happen, has happened.

    Because i've got so many SubVIs and nested SubVIs (I need them really as i'm using Labview 2 style globals to manage counters and common repeating tasks - i'm assuming that's a good approach?) the performance suffers - now i've moved that into the main loop and removed the other, the output is occuring, but there's a lag and it's sometimes missing its deadlines.

    That was why I chose 2 loops - I might try and change the output to a queue maybe, to queue up all output, so nothing is missed - it's all a bit tricky!

    4325[/snapback]

    The code you submitted does not have many nested sub-vi's. I've developed applications with thousands of VI's and they run very quickly, efficiently and everything is synchronized. Your code is very lightweight so the lag you are seeing must be comming from somewhere else. The solution to your problem is to simply to create subvi to handle the port writing and place that wherever you need it. I built a quick VI to do this for you and I modified your original code to include this VI. Basically just place the VI down wherever you need to modify one item. The VI remembers the previous states of all the items so you don't need to worry about synchronization.

    One thing I noticed is the multitude of File IO. Is this really necessary? File IO is a big bottleneck.

    post-2-1111825777.gif?width=400

    Download File:post-2-1111825775.llb

  3. can Labview use with Php or MySQL, so, we can use the data and monitor them

    4213[/snapback]

    You can talk to a MYSQL database with LabVIEW using the Database connectivity toolkit or other tools floating around. What do you need the PHP for? You don't need this to access database data. Please explain the need for LabVIEW to talk to PHP.

  4. i have another local variable elsewhere on my VI in a differing while loop that reads the value of this and will react to a change in an event structure

    4112[/snapback]

    This statement doesn't make sense. An event structure cannot react to a change in a local variable. Event structures only react to front panel events.

    It should be ok to use a local variable to pass data, however there is no synchronization. You have no guarantee that the loop has read the old data in the local before new data has become available.

  5. The LabVIEW scripting Forum is a place to discuss and investigate ways of using LabVIEW to programmatically generate LabVIEW code. In other words you can write a VI that will (when executed) create another VI. You may have seen some of this functionality in use already. NI uses this capability internally in some of their code generation tools. For example, if you right-click on a DaQmx task node you can select an option that builds a code example or a configuration VI. This wizard uses special undocumented features of LabVIEW to do this.

    VI scripting is a powerful new LabVIEW feature based on existing VI Server technology. Using the scripting API, you can create new VIs, create new front panel and block diagram objects, modify existing front panel and block diagram objects, or inspect existing front panel and block diagram objects. VI scripting allows you to write a VI to programmatically accomplish almost anything you could accomplish in LabVIEW's interactive editor.

    VI scripting is not advertised or available in the LabVIEW help files that are distributed with LabVIEW. This could be for many reasons. Some of these are:

    - NI has not finalized the implementation.

    - The implementation is hard to use and NI wants to make it user friendly.

    - NI has not decided to make it a publicly available product.

    - The existing implementation contains many bugs.

    - NI does not want to burden the support system with issues related to an unreleased product.

    Because of the previous statements, you are on your own:

    DO NOT contact NI for support on VI Scripting.

    DO NOT use these features for released code or applications to your customers.

    DO NOT count on the implementation to stay the same for future releases of LV. It will change and your code will not be upgradable.

    And Finally-->

    Your computer will explode, you will lose all your valuable data and local law enforcement will come knocking on your door.

    So BE WARNED! Do not blame NI or anyone here at the LAVA Forums for any problems that may arise from using these features.

    The Details:

    VI Scripting is exposed to you via methods and properties. To enable these methods and properties, you must add the following line to your labview.ini file. This file is located at:

    C:\Program Files\National Instruments\LabVIEW 7.1\labview.ini

    Add the following line:

    SuperPrivateScriptingFeatureVisible=True

    After you restart LabVIEW, place a property node down and click on the various properties. You will notice more items in your list.

    post-2-1109304295.gif?width=400

    One more thing. To expose the "create object" primitives shown below, you must install VIPM and install the package called: ogmnu_appcontrol_plus

    post-2-1109304543.gif?width=400

    *Update*

    Others have also had success with the following ini entries (don't know what they do):

    SuperSecretPrivateSpecialStuff=True

    *Update*

    Adam Rofer has made some interesting discoveries on some scripting related information. He calls them XNodes.

    Good work Adam. :thumbup:

    Here is the website: http://xnodes.lavag.org

  6. See link:

    Student Robotics in China

    Dr. Yun had observed that robotics combined so many areas of technology and that students naturally responded to robotics with great energy. His team created the AS series of robots and convinced the Chinese government to try it as an educational

    "demonstration" program in 2000. The tests proved successful, and robotics has been integrated into China's national high school curriculum. In some provinces, every high school student now studies robotics for at least one semester.

    The AS-M system meets the needs of a wide range of roboticists. Beginners learn the robotic basics of electronics, mechanics and software programming. The AS-M's "VJC" graphical programming language teaches logic and proper design right from the start. For intermediate students the AS-M's unique interchangeable sensor system lets users create sophisticated solutions with minimal delay. More experienced programmers can actually "lift the hood" on the graphical programming language, and work directly with the "C" code inside, giving them complete control. The VJC software runs with any version of Windows from 98 onward, and we've even had good results using it on a Macintosh running Virtual PC software and a USB to serial converter.

    post-2-1108918453.jpg?width=400

  7. The VI with the time critical code contains several sub-VIs that are called sequentially. Do I need to set the priority of these VIs to "Time-Critical" as well? Or is this "inherited" from the calling VI? In other words, do sub-VIs in a time critical VI run at that priority regardless of the priority that was selected in the sub-VIs properties menu?

    3770[/snapback]

    By default, if you don't touch the priority settings on the sub-vi's they inherit the settings from the caller. Time-critical priority really only has significant effect in a LV real-time OS. Is this the case?

  8. Now that I'm hip-deep in my first real Lab-View deliverable (I hope) project, I don't think I'll ever be able to listen to Neil Young's  "Broken Arrow" the same way again.    :laugh:

    Happy Bob Marley Day Toronto!

    3759[/snapback]

    Did you also think that the movie "Broken Arrow" was a story about a frustrated LabVIEW programmer battling the forces of evil to get his little Vi to work?... I did. :P

    Broken Arrow

  9. Yes, I know I should have said: to avoid the need to install/download OpenG(1), and if you don't need/want OS independent code, and you're not interested in mixed EOL characters, and, and, and, ... but I thought I had covered that with "smooch"  :)

    1. although you should've done this as the first step after purchasing LV, IMHO.

    P.S. Michael, I will always welcome corrections! That's how you learn! In this case however, the code was just using the tool with the EOL as delimter as a quick solution.

    3753[/snapback]

    Ok guys. I have an issue with this implementation with respect to showing new users how to do things. I now understand what you are trying to show Alex but the "proper" conversion of a CSV file to an array would go something like this:

    post-2-1107408509.gif?width=400

    Let's not forget that the original question was asking about a CSV (comma separated values) string.

  10. A quick search on the NI site came up with this:

    Will My Palm OS 5.2 Running an ARM Processor Work with the LabVIEW PDA Module?

    Problem: Will my Palm OS 5.2 running on an ARM processor work with the LabVIEW PDA (LVPDA) Module and why is the ARM processor grayed out?

    Solution: Yes, if you are using a Palm OS 5.2 running on an ARM processor it will work if you run it using the Motorola 68K processor. The LVPDA module was developed before the Palm was supported by ARM and therefore is not an option. The only reason that the ARM appears as a grayed out option is that it is the default processor for Pocket PC and both modules use the same dialog box.

  11. PJM,

    In the thumbnail attached to this post, there is an apparent OpenG Scripting palette. I can't find it on this or the OpenG site. Is it available?

    3703[/snapback]

    This is PJM's personal palette. Perhaps with a little coaxing, we can get him to submit an openg package with these goodies...

    I believe the closest thing OpenG has to scripting is the ogmnu_appcontrol_plus package. It can be downloaded with Commander.

×
×
  • Create New...

Important Information

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