Jump to content
Prabhakant Patil

[CR] Create_Scale_LV2010

Recommended Posts

index.php?app=downloads&module=display&section=screenshot&id=214

Name: Create_Scale_LV2010

Submitter: Prabhakant Patil

Submitted: 02 Jul 2012

File Updated: 12 Jul 2012

Category: Hardware

LabVIEW Version: 2010

License Type: BSD (Most common)

Create_Scale_LV2010 v1.0.0

Copyright © 2009, Prabhakant Patil

All rights reserved.

Author: Prabhakant Patil

LAVA Name: Prabhakant Patil

Contact Info: Contact via PM on lavag.org

LabVIEW Versions: 2010

Dependencies:

1. NI DAQmx Device Driver

2. OpenG Application Control

3. LabVIEW Runtime engine 2010

Description:

This example is used to create / update / delete daqmx scales. Using this variuous types of scales can be created like Linear, Map Ranges, Polynomial and Table.

Also using this you can delete or update existing scales.

If you have any suggestion on the same, please let me know to improve it.

Version History:

v1.0.0: Initial release of the code.

License:BSD

Distributed under the Creative Commons Attribution 3.0 (http://creativecommo.../about/licenses)

See link for a full description of the license.

Support:

If you have any problems with this code or want to suggest features:

please go to lavag.org and Navigate to LAVA > Resources > Code Repository (Certified) and

search for the "Create_Scale_LV2010" support page.

Click here to download this file

Share this post


Link to post
Share on other sites

Looks like you put in a lot of effort into this. One thing I noticed is the list of existing scales show all scales, even ones that are not appropriate for the current tab. So if I have a linear scale, but am on the Map Ranges tab, my linear scale shows up in the list, and trying to edit it doesn't work. Why not only populate the drop down with the scales for that type?

Also is there a reason you are doing this all manually instead of using the DAQ Assistant? Attached is a quick VI I made to edit or create a scale. You may need to update the path constant on the block diagram to point to your DAQ Assistant because the path is set currently to a 64-bit Windows, running LabVIEW 2011.

Add Edit Scale.vi

  • Like 1

Share this post


Link to post
Share on other sites

I haven't tested it in anything other than in a development environment, but I believe it will work in RTE as long as the DAQ Assistant VIs are installed. The DAQ Assistant VIs actually call a NI DLL called mxwlvapi.dll, this is what actually does the heavy lifting and I assume this is installed with DAQmx.

So theoretically you could create an installer, which has the added installer of DAQmx and this should still work, that is assuming you get the path to the Assistant VIs correctly. I believe there is a registry read that can be performed to help find this. Possibly something like %National Instruments Folder%\MAX\Assistants\DAQ Assistant\common\supportFiles

As for how I did it...well, the forums have been discussing very grey topics lately, and one of them is block diagram passwords, and how they have been defeated. So out of my curiosity I started looking into all the VIs that were locked in VI.lib to see if I could find anything useful. I couldn't find much, most of VI.lib that has a password is simply a dll call. AQ has mentioned recently that most of the passworded VIs have been unpassworded to help share with the community and that is apparent here. So I searched my whole National Instruments folder and found these llbs named expressVIsXX.llb with different versions for all versions of LabVIEW. By opening up the daqmxNewItem.vit and daqmxEditItem.vit you can see that it has a control that gets casted to a DAQmxName object, and has code for Channels, Tasks, and Scales.

So you can actually use this same code to Create/Edit a Virtual Channel or Task. I'm not sure why this information isn't a knowledge base somewhere other then the fact that NI may choose to change how these VIs work in the future.

AQ has mentioned recently the dangers of using code from a password protected block diagram, but I don't believe this falls into that category, because I didn't use any code from a passworded VI, I'm just calling it, and I needed to know the type of input it wanted for a control. Looking at the BD helped me understand what was needed. In any case NI can still choose to change this functionality in the next version of LabVIEW if they choose.

Edited by hooovahh
  • Like 1

Share this post


Link to post
Share on other sites

Looks like you put in a lot of effort into this. One thing I noticed is the list of existing scales show all scales, even ones that are not appropriate for the current tab. So if I have a linear scale, but am on the Map Ranges tab, my linear scale shows up in the list, and trying to edit it doesn't work. Why not only populate the drop down with the scales for that type?

Also is there a reason you are doing this all manually instead of using the DAQ Assistant? Attached is a quick VI I made to edit or create a scale. You may need to update the path constant on the block diagram to point to your DAQ Assistant because the path is set currently to a 64-bit Windows, running LabVIEW 2011.

Hi

I have downloaded this VI. But this is devloped in LV 2011.

Can you save it to lower version, so I could do study it, and if possibly implement it.

Yes DAQ Assistance is get installed along with the DAQmx. and each daqmx VI uses a DLL to coomunicate with the hardware.

I gone thriugh the DAQ assistance, it will allow you to create channel and Task, but it wont create scale. we need to create scale seperately, and it is input to the task.

Edited by Prabhakant Patil

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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