Prabhakant Patil Posted July 2, 2012 Report Share Posted July 2, 2012 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 Quote Link to comment
hooovahh Posted July 2, 2012 Report Share Posted July 2, 2012 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 1 Quote Link to comment
hooovahh Posted July 3, 2012 Report Share Posted July 3, 2012 (edited) 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 July 3, 2012 by hooovahh 1 Quote Link to comment
Prabhakant Patil Posted July 4, 2012 Author Report Share Posted July 4, 2012 (edited) 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 July 4, 2012 by Prabhakant Patil Quote Link to comment
hooovahh Posted July 5, 2012 Report Share Posted July 5, 2012 I have downloaded this VI. But this is devloped in LV 2011. Saved in 2010 Add Edit Scale 2010.vi Quote Link to comment
Prabhakant Patil Posted July 5, 2012 Author Report Share Posted July 5, 2012 Thanks a Lot Quote Link to comment
Mark Balla Posted July 15, 2012 Report Share Posted July 15, 2012 Certified 7-14-2012 Placed in Hardware Category Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.