Custom Scale behavior with DAQ Task running

Hi to everyone, I am implementing a Polynomial Custom Scale for a sensor, but I have doubt about what happens if I change a Custom Scale and my DAQ Task is running, I suppose that the Custom scale does not change on the fly but my questions is if I have to clear the Task to apply the new custom scale or is enough with Stop the Task and Start the Task again.
I am using the DAQmx functions for the code. Thanks for your help.

Hi AYanez!! 
Thank you very much for using NI Discussion Forums!!  I found a post that deals with the same issue you are trying to solve for your application.  It seems that you have to stop the task for the new scaling properties to be applied.  Take a look into this thread:
Programmatically applying a custom scale in an active VI
Hope this helps!
Regards,
Anuar R.
National Instruments México y Latinoamérica
Ingeniería de Aplicaciones
www.ni.com/soporte

Similar Messages

  • LV 8.21: strange behavior with DAQ tasks, parallel running VI's and shift registers

    Hello,
    I have made a VI using DAQmx vi's. The VI uses shift registers to store DAQ tasks and other (internal) information. I have implemented  several modes of operation (enum control with a case structure) like 'init', 'read AD', 'config AD' etc. If I use this multi mode VI in a single main VI everything work as expected. I have attached a jpg that shows one example where the DAQ VI is called from 2 parallel running while loops. One loop aquires the data (LOOP 1) while the other loop configures the aquisition task (LOOP 2). If I implement the same thing by putting LOOP2 in a different VI that runs seperately from the first VI I get an error message (200428):
    Possible reason(s):
    Measurements: Value passed to the Task/Channels In control is invalid.
    The value must refer to a valid task or valid virtual channels.
    Task Name: EasyDAQ_AD
    Of course, the second VI is started manually after the 1. VI has passed the initialization part. The error message is triggered from the 1. VI that executes the DAQ task. From my understanding of the LV execution system this seems like a bug to me. Does anyone have an idea what could go wrong here?
    klaus
    Attachments:
    problem.jpg ‏30 KB

    1. In general, this kind of technique is something I've been using successfully for years.  (Ben recently wrote up a very nice treatment of these "Action Engines" as a "Community Nugget.")  So I don't start by expecting this to be a bug in the LV execution system.
    2. Your description of the problem sounds almost backwards.  You say you manually start the 2nd vi ("Config AD") *after* running the 1st vi ("Read AD").  Seems like you'd need to do the Config 1st and then do the Read, right?   I kinda suspect you actually did it in the right order, but described it wrong.
    3. The next likely scenario is that the Config failed, but you didn't trap the error and were unaware of it.  Then it makes sense that the Read would also fail.
    4. A couple issues I regularly deal with in these DAQ Action Engines is internal error handling.  I often keep a shift register inside to store errors generated inside the Action Engine.  But it can get a little tricky doing sensible things with both the internal error and any other error being wired in as input.
    I said all that so I can say this: if you have complex nested case statements, or lots of different action cases to handle, double check that the task wire makes it from all the way from left shift register to right.  Sometimes they get lost if they go through a case statement, the output tunnel is set to "use default if unwired", and 1 or more of the cases don't wire the output.
    -Kevin P.

  • Custom scale inoperative in accelerometer task

    I am using a NI 9234 to measure acceleration. In the Acceleration task, I have fixed the sensitivity at 1000mV/g and I am trying to use a Custom Scale to correct for the actual sensitivity of the accelerometer(~10mV/g). The excitation is set to Internal and 2mA. The input is AC coupled. When I run the task, the scale has no effect on the output values. With 1G applied to the accelerometer, the output remains at ~.014G(pk) regardless of whether a Custom Scale is used or not. Is this normal behavior for an accelerometer task?
    LabVIEW 2009 SP1
    NI-DAQ v9.1.1
    Phillip Neir
    GM Engineering
    Solved!
    Go to Solution.

    2mA is the lower end of most sensors supply current.... however should work.
    When you say you apply 1G, do you mean 1G peak @ say 160Hz? If you apply 1G static you will see only a small signal while the sensor is moved but no static change since the AC coupling (and maybe even your sensor) don't allow static measurements.
    A quick coarse check: fix your sensor on a speaker and place a small brass nut on top of the sensor (or nearby)  and apply something like 50 to 200 Hz. Slowly increase the amplitude and watch the sensor signal. At an acceleration slightly > 1G the small object will lift off and bounce back and you can see it in your signal (and even hear it , but watching the signal is more sensitive )  
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • Unpredictable Custom Remote Behavior with ATV v3.0.1

    I discovered a problem with the new Apple TV (ATV) v3.0.1 software download. It seems that this download has a bug in it regarding the programming of remote TV contollers, such as the DirecTV remote that I had been using. AppleTV allows you to program any remote to control the ATV screens. I had previously programmed my DirecTV remote to control the ATV when set in the AV1 mode. It always worked fine. After the new ATV software was updated a few weeks ago, it mysteriously allowed the ATV to respond to DirecTV commands (when not in AV1 mode). Thus, random commands were being sent the the ATV causing random (unseen) migration through its menus. Eventually, a random movie was selected (unintentional, of course). This actually happened more than once. I have since re-progammed the ATV for the DirecTV remote and everything is back to normal. Anyone else experience this problem?

    Unfortunately this is a symptom of any upgrade on any equipment. Upgrades can make older equipment incompatible entirely, require updates for other equipment or simply (as seems to be so in your case) require the device to be set up again or make settings adjustments.

  • Custom scale for counter input?

    Hello everyone,
    Is it possible to create a custom scale for a counter input? I saw there is a feature to allow input Custom Scale Name to the Channel Property Node. However, when I tried to create a custom scale to input to the channel, I got this error
    Error -200212 occurred at DAQmx Read (Counter DBL 1Chan 1Samp).vi:1
    Property: CI.MeasType
    Corresponding Value: Count Edges
    Property: CI.AngEncoder.Units
    Corresponding Value: From Custom Scale
    Channel Name: CountEdges
    Task Name: MyCountEdgesTask
    Do you know what is the problem with it? Thank you

    How do you have the channel set up? Can you attache the VI's that you are using? Is this a global virtual channel?
    Tim
    Johnson Controls
    Holland Michigan

  • Save custom scale while associated task is running

    Hi,
    I would like to know if it's possible to change the value of a custom scale while a task (using this scale) is running ?
    If yes, when will the new coefficients be applied ? 

    On the deivices I used, you have to stop the task and restart it to apply a different custom scale.
    Consider doing scalling "on the fly" with formula nodes, Polynomial Interpolation, lookup tables, or whatever works for your scale. This way, changing on the fly is easy.
    Richard

  • Running powershell script with customer parameters as a scheduled task

    tfl wrote:I guess I don't get why you are wanting thisMy regular tasks run,. and take data from data files. Want your batch to get processed today? Then add it to the queue file by 5:00 PM.. The task runs at 5:01 and works with whatever data is available. And if the file is empty, nothing happens each night. If you want to pass parameters like this, then why bother with a scheduled task? You'd need to remove the old one and add the new one each time. Which is extra work and complexity, especially if the task at hand is in any way 'dangerous' if run twice with the same data (ie you forget to change the task or remove it).I'm using a scheduled task to trigger the script, I'm using the "on event" trigger and then calling the script as an action. The method I was using before (calling via a bat file with the event Id hard coded into that"...

    Hi all,Having one of those hair pulling issues where something should work but for some reason its blindly refusing not to!I've created this script that is a bit of an extension to the email on eventID for task scheduled. It basically pulls out the various information from the actual event and fires off an email to our alerting team to investigate etc.That all works great, but what I'm now trying to do is get it to accept a custom parameter so the actual event ID its looking for doesn't have to be hard coded and can be passed to it via the commandline etc. I've got it all setup and work great but for the life of me can't get it to work correctly when set as a scheduled task. This is what the command basically looks like:powershell -executionpolicy bypass -command "& 'pathtofile\script.ps1' -evtid 8004"The latter part is the customer...
    This topic first appeared in the Spiceworks Community

  • Custom scale with Create Channel CI Position Angular Encoder

    Hi!
    In my application I use angular encoders for position measurement. I programatically create channel (task) using DAQmx Create Virtual Channel, CI Angular Encoder instance. Prior to that I use DAQmx Create Scale to create custom scale for the measurement, to convert from degrees directly to meters. The problem is that when I use the task (Start Task for instance) I get the following error message:
    Error -200378 occurred at DAQmx Start Task.vi:4
    Possible reason(s):
    Measurements: Custom scale specified does not exist.
    Custom Scale: RowCounter
    Task Name: _unnamedTask<66>
    Maybe somebody can help me out with this one.
    I use the same principle to create custom scales for AI measurements, and everything works without any problems. I know the scale is created properly, as I tried saving the custom scale to max after I create it. I then used the scale without a problem when I wired it as a constant to the custom scale input of the DAQmx Create Virtual Channel vi. It only gives me problems when I create it dynamically, using Create Scale vi.
    Some technical info: I use USB-6210 Daq card for signal acquisition.
    I will appreaciate any help!
    Jernej

    Hey!
    The error message I get is as follows:
    Error -200378 occurred at DAQmx Start Task.vi:4
    Possible reason(s):
    Measurements: Custom scale specified does not exist.
    Custom Scale: RowCounter
    Task Name: _unnamedTask<66>
    I use USB-6210 Daq card for signal acquisition. The error occurs right after the DAQmx Start Task.vi on the counter task.
    As I said, the code runs sometimes without problems and then sometimes it returns an error. I noticed that if I run the CustomScaleProblem.vi on its own it runs ok. When I open the project with mine application, from where I extracted CustomScaleProblem.vi part, and then try to run the CustomScaleProblem.vi, it stops working. It looks like when I open the project it allocates some space which is in conflict with the scale part of the code. Then if I close the Labview environment and open CustomScaleProblem.vi and run it, it runs again without any problem. Well, for now I did a work around the problem by saving the scale in the program and then using it. This approach works fine.
    About the arm start trigger. I use it because I dont want the counter to start counting before the AI task starts. I noticed that if I use the AI as a start trigger, and I move the encoder before AI starts, the counter will not start with 0, but will start with a number indicating the encoder movement before the AI start. Is that the right approach if I want the encoder to start
    counting from 0 when AI starts?
    Thanks and kind regards
    Jernej

  • DAQ task update during running task

    Hi,
    I hope sombody can answer this question.
    Is it possible to update a running DAQ task without stopping the task?
    In my task I have an analog output and I want to change the amplitude and/or the duty cycle of the output waveform.
    Stopping the task and starting again with new parameters needs to much time.
    Thank you,
    Robert

    If you're just looking to write new data to the task then there shouldn't be any need to restart it (you can use AO with non-regeneration like DianeS mentioned).  I wanted to make sure to mention that we have an online example that does just this:
    Update Multiple Channels of Analog Output On-The-Fly
    Additionally, there are some properties that are settable while the task is still running (e.g. AO Sample Rate can actually be changed on-the-fly on many of our Multifunction Boards).  Other properties (e.g. AO Voltage Range) cannot be modified without first stopping the task.  If you need to stop the task and reconfigure, Ben's method is a good idea.  I am aware of an example that does this for Analog Input tasks but I don't think we have one for AO.  Here's the link to an AI version in case anybody is interested (unlike AO, the AI Sample Clock is not changeable on-the-fly):
    Switching Between Multiple Analog Input Tasks in DAQmx
    From what it sounds like, the first link should be exactly what you need and you shouldn't need to worry about restarting your task.  Just add Duty Cycle to the control cluster and wire it into the
    correspnding input of the Basic Function Generator.  If you have any questions about it or run into any issues don't hesitate to let us know!
    Best Regards,
    Message Edited by John P on 03-25-2010 06:35 PM
    Message Edited by John P on 03-25-2010 06:36 PM
    John Passiak

  • How to convert prescaled to postscaled values with custom scale?

    Hi,
    Is there any way to convert between prescaled and postscaled values using an arbitrary custom scale (i.e. linear, map, polynomial, or table)? 
    I'm trying to write a driver which allows users to choose an arbitrary (previously defined) custom scale, but I need to know within the program the values which are actually output/input, which means I need a way of determining the max/min values for an arbitrary custom scale based on the known unscaled max/min.  Surely there is a NI-DAQ internal function which accomplishes this task, but there doesn't seem to be a VI for it.
    Any ideas?
    -Lee
    Labview version 9.0f3

    Dustin,
    Thanks again for your suggestion.  I'm sure your example will be useful to others, but I'm afraid it doesn't actually address my question.  I guess I'm not being very clear.
    The point is that I want to keep track of the values currently being sourced on my analog output channels.  In my application, users can specify max and min values for the sources, which may reflect the hardware limits of the device (e.g. +/-10V in my case) or a more constrained set of software limits determined by whatever the channel is driving.  If the user tries to write a value outside this range, it will be coerced and the limiting value will be sourced instead (without generating an error in this case).  It is then this limiting value which should be saved in output memory, rather than the out-of-range value requested, to avoid users believing they have sourced a value they have not.
    If I then allow users to choose a custom scale, then the requested values are given in scaled units, while the device max and min are still unscaled (volts).  This means I need a way to convert the unscaled limits to scaled limits based on an arbitrary custom scale in order to accomplish the procedure described above.  I have attached an example VI that handles linear scales only.  Obviously this could be extended by adding a case structure to handle the other types of scales, but it just seemed a bit silly to me that there is no VI to accomplish this scaling already, given that it most certainly happens inside the various NI-DAQmx routines that accept custom scales.
    Much of this would also be easier if it were possible to 'read back' the currently sourced value from DAQ output channels, so I wouldn't have to fake it by keeping a local memory of them, but that is a separate issue.
    -Lee 
    Attachments:
    ApplyScaledLimitsExample.vi ‏23 KB

  • Running Function Module in Background with Update Task is not working

    Hello Friends,
    I have a "Z" Report Program where I am running this Report in Background using JOB_OPEN, JOB_SUBMIT, JOB_CLOSE. I am calling this in BADI.
    In this Report I am calling another Function Module PRICES_POST which is a standard Function Module and in this FM there is another FM 'CKML_UPDATE_MATERIAL_PRICE IN UPDATE TASK'. Now when I am running the BADI these values are not being updated.
    Friends I would like to know whether can we run Function Modules which are  included with UPDATE TASK as Background Job program?
    Kindly help me in providing your valuable suggestions in proceeding further.
    Thanks and Regards
    Pradeep Goli

    Usually the sequence of CALLs in your report should look like
      CALL FUNCTION 'CM_F_INITIALIZE'
        EXPORTING
          msg_on_screen = c_x.
      CALL FUNCTION 'CKMS_BUFFER_REFRESH_COMPLETE'.
      CALL FUNCTION 'PRICES_CHANGE'
        EXPORTING
          actual_bdatj = f_matpr-pp-bdatj
          actual_poper = f_matpr-pp-poper
          bukrs        = p_bukrs
          budat        = p_date
          xblnr        = p_xblnr
        TABLES
          t_matpr      = t_matpr.
      READ TABLE t_matpr WITH KEY pp-xerror = ' '
                                TRANSPORTING NO FIELDS.
      IF sy-subrc <> 0.
        MESSAGE i046(ckprch).
      ELSE.
        CALL FUNCTION 'PRICES_POST'
          EXPORTING
            i_bktxt    = p_bktxt
            bukrs      = p_bukrs
            lis_update = 'X'
          TABLES
            t_matpr    = t_matpr.
      ENDIF.
      COMMIT WORK.
    If you forget the COMMIT-WORK each and every FM called in UPDATE TASK will not be triggered.
    Regards,
    Raymond

  • When I close Firefox, then later want to start up again, I get I message that Firefox is still running. With "START TASK MANAGER", I need to close Firefox in order to start again.

    When I close Firefox, then later want to start up again, I get I message that Firefox is still running. With "START TASK MANAGER", I need to close Firefox in order to start again.

    I have the same problem. Firefox won't unload regardless of how long I wait. Literally hours ... I must go in and 'end the process'. This has been a real hassle for a while now. Even considered giving up on firefox. Please look into this! An additional problem; I have to run firefox to get the updates, but I can't get the updates to take because I can't get firefox to unload so I can restart it.

  • "Run Script" (F5) Flacky Behavior with CREATE PROCEDURE and PACKAGE

    When I have the following create statement in a SQL Worksheet and run the script using "Run Script" (F5), I get the "PROCEDURE bogus Compiled." message. Why does it not tell me that there was a compile error? The procedure is marked with a little red "X" in the connections pane.
    CREATE OR REPLACE PROCEDURE bogus IS
    BEGIN
      x := 1;
    END;
    /Also, when I have the following command in a SQL Worksheet and run the script using "Run Script" (F5), I get the "PROCEDURE bogus Compiled." message. The difference is that I removed the slash after the CREATE PROCEDURE command. I can go into that procedure in the database via the Connections pane, click on the compile button, and the procedure compiles with no errors. Why does it not compile in a script when missing the slash?
    CREATE OR REPLACE PROCEDURE bogus IS
    BEGIN
      NULL;
    END;I noticed the same flaky behavior with CREATE PACKAGE BODY as well. This is in version 1.0.0.14.67 on Windows XP. Has this been fixed in the latest version?
    Mike

    I found a number of earlier posts on this (going back to at least v804), but I cannot find a thread with a response from the SQL Developer team - see:
    Package compilation error
    Succesful compilation message and Compiling Invalid Objects
    Creating a stored procedure from a file does not show compilation errors
    Re: Syntax Error Feedback
    I assume that it is just a bug with SQL Developer that it does not check for compilation errors when determining the status message to display (ie "PROCEDURE bogus Compiled"). At least now we get the little red cross on the navigator to tell us it is invalid :)

  • How do I increase the precision of a timestamp acquired with a DAQ task?

    Hi
    I am using a DAQ task to acquire multiple channels of analog data. The waveform data already has timing information incorporated into it. I wanted to know if there was a way of increasing the accuracy of this timestamp information - (Its currently in seconds with a default ms offset for each sample).
    Thanks
    Brinda

    Hello Brinda,
    From your posting, it sounds like you are acquiring some waveform data and plotting it to a LabVIEW graph. Unfortunately, the ability to increase the timestamp of your acquired data is going to be a limitation of using a non-real time operating system such as Windows. You may have a device which can sample to some very small precision of accuracy, but if your OS is not able to transfer the data fast enough and timestamp it, then you will see a less precise timestamp than you were hoping. A workaround to get around this would be to use a real time environment and the LabVIEW Real Time module. If this does not seem to be an option, you may also want to consider trying to use a counter to perform the timestamping, or take a look at the LabVIEW exam
    ple program I have linked to below.
    Timestamping Analog Input Data Using a Counter (DAQ-STC)
    Precise Current Timestamp with Milliseconds
    Best of luck.
    Jared A

  • Why do I receive Error 200378 "Custom scale specified does not exist"?

    I am trying to perform offset nulling using an NI-9237.  I receive and error in regards to the custom scale even though I programmatically create the scale prior to the task.  I am experiencing the erro whne using LV8.2.1 but with LV8.6 the problem disappears (same code, just open in LV8.6 and run)
    The error is the following:
    Error 200378 "Custom scale specified does not exist" 
    Possible reason(s):
     Measurements: Custom scale specified does not exist.  Custom Scale: test
    Channel Name: LoadCell_StrainGage_Sim/ai0
    Task Name: _unnamedTask<F>
    I have attached the code in LV8.2.1
    Thanks
    Dan
    Attachments:
    test.vi ‏38 KB

    Dan,
    I tried your VI and it worked for me after I changed the channel from "LoadCell_StrainGage_Sim/ai0" to something that was on my system.  Before that, I got the same error.  So...are you sure that there is LoadCell_StrainGage_Sim/ai0 configured in MAX?  Stupid question, I know, but it was the only thing I changed.
    -Matt
    -Matt Bradley
    ************ kudos always appreciated, but only when deserved **************************

Maybe you are looking for