How to multiply the channel by variable

Hello

I have a timestamp that is not real time, but the next number. I know that the interval (such as 1 or 10 seconds) of the measures. So I am this conversion to standard time. In this case, I need to multiply this channel by given interval. It's easy, because you can multiply the channel by a constant like below:

  Call ChnCalculate ("Ch(""[2]/Seconds1"") = Ch(""[1]/#"") * 1")
Call ChnCalculate ("Ch(""[2]/Minutes1"") = Ch(""[2]/Seconds1"") / 60")
Call ChnCalculate ("Ch(""[2]/Hours1"") = Ch(""[2]/Minutes1"") / 60")

But how to do this using the variable? Let's say we have variable s_interval and we want to put this variable instead of multiplying it by constant.

Ch(""[1]/#"") * 1 ")

Do you know how to do this?

Best regards

Piotr

Hi Piotr,

You can set it like this:

Dim dFactor
Call ChnCalculate ("Ch(""[2]/Noise_1"") = Ch(""[2]/Noise_1"") /"& dFactor ")

But I prefer a DIAdem function for this calculation, because it is faster using a well-defined function than the calculator.

Dim dFactor, dOffset
dFactor = 10
dOffset = 0
Call ChnLinScale ("[1] / Time", "[1] / Time", dFactor, dOffset)

or if you use the channel object:

Dim oChn, dFactor, dOffset
Set oChn = Data.GetChannel("[1]/Time")
dFactor = 10
dOffset = 0
Call ChnLinScale (oChn, oChn, dFactor, dOffset)

Greetings

Walter

Tags: NI Software

Similar Questions

  • How to get the channels spot given colors and spot channels length

    File is CMYK format... channel spot color is CMYK we as a spot channel color is c100m50y20k5
    How to get the channel spot color data using javascript? c = ? m = ? y = ? k = ?
    howv to get your channel length n (not the CMYK channel) use javascript?  such as CMYK + spot n-channel 7 = 7

    Please help me

    #target photoshop

    var myDoc = activeDocument;

    var channel = myDoc.channels;

    var number = 0;

    for (var m = 0; m< channels.length;="" m++)="">

    If (channels [m] .kind == ChannelType.SPOTCOLOR) {the number ++}

    };

    Alert (the number + "spotchannels");

  • multiply the channels with a constant

    Hello

    I want to multiply all my channles with a constant value say 4.3

    So I thought to generate a new string with all its value as 4.3 and multiplying this channel with my current channel. I used

    Dim MyChnName, I have

    MyChnName = ChnAlloc ("Mass", 2400, 1, DataTypeFloat64, "Numeric") ' Allocate channel of text
    For i = 1 to 200
    CHT (i, MyChnName (0)) = "4.3" & I "create value of text
    Next

    But it generates values as 4.31, 4.32... 4.3XXX

    I want that all the values are constant. How can I modify my code to do this?

    Or multiply all my channle with 4.3 values directly (without creatine a channel) how to move forward with this?

    Hi Rash.patel,

    Do you really speak a text - which means «abc123...» » ? According to me, not because you set a digital channel with chnalloc. And in the next line, you connect traction chains:... = '4.3' & I. VBS connection string is just the strings together as "abc" & "123"-> "abc123". I think that this is not what you want to do. If you use a loo, you must set:... = 4.3 + i

    But in general, you must use the DIAdem Standard mathematical functions because they are much faster than looping through the unique string values.

    In the DIAdem mathematical basis, you will find the functions you need, like scaling, offset correction...

    Greetings

    Walter

  • How to change the channel of my SONY HDR-CX440 wireless?

    I'm live streaming video from my sony HDR-Cx440 to an iPAD using app "playmemories Mobile". Communication between these two seems to be on Channel 6 and which interferes with my other wireless devices. I want to change the channel from 6 to any other channel wireless. How can I do?

    Salvation TV,.

    Welcome to the community of Sony!

    We're sorry, but there is no way to change the configuration wireless from the camera to a different channel.

    If my post answered your question, please mark it as "accept as a Solution. Thanks_Mitch

  • How to access the channel values?

    I'm new to scripting language DIAdem.  I TDMS has a group and several channels with String type all.   How to read the first 4 characters of each string values and store into the new channel?  Example of data file attached.

    I tried for the statement in the Script window

    Ch("[1]/result") = Ch("[1]/Frame")

    or

    Ch("[1]/result") = Right (Ch ("[1] / framework", 3))

    All gave me error...

    Hi NiCoder,

    It's the way you read and write individual channel values, but what to do value-by-value is much slower that make them all with a single call to ChnCalculate():

    Set Group = Data.Root.ChannelGroups (1)
    Define FrameChannel = Group.Channels ("Frame")
    Set ResultChannel = Group.Channels.Add ("Result", DataTypeString)
    iMax = FrameChannel.Size
    FOR i = 1 TO iMax
    ResultChannel (i) = Right (FrameChannel (i), 3)
    NEXT ' I

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • How to detect the channel delete event in a custom device

    I am creating a custom device and want to detect when you press the button Delete (X) in the system browser.  This is so I can increment or decrement a counter in a folder (where the channel is under).  I saw no option in UserEvent loop options.  How do I detect that a channel is deleted?, I'm sure it's easy, but I can't seem to understand.

    Thank you!

    I recommend usually do not do that... If you can avoid it. For example the parent folder can do if everything is just a child get point-> the size of the array to count channels rather than storing a property that could get out of sync. I always try to design my devices do not store the property values for things I could go get.

    That being said... Sometimes you don't have that. You want an actionviondelete: https://decibel.ni.com/content/docs/DOC-30447

  • How to create the channel listens for XML/web services line

    Hi, I'm new to B2B 11 g, would ask tht,.

    I followed the tutorial of B2B using generic file and it works fine. However,.
    If I want to receive the trading partner thought web XML server, how can I configure the channel look, what protocol to use.


    And can any1 kindly refer me to any link or info?

    Thank you.

    However... If remote partner is going to send me thought web services and no thought record, should I do something on my B2B? has I need specific, any channel listen extra?

    N ° no additional configuration is required to receive files via HTTP. Just ask your TP to post files on one of the below URL.

    http://hostname:soa_server_port/b2b/httpReceiver or http://hostname:soa_server_port/b2b/transportServlet

    If you just want to test your B2B, if it is correctly configured best way is to have another facility of B2B (may be a new domain) who will laugh at your configuration TP. This configuration of B2B send message to your B2B on HTTP (on one of the above URL) and see if gets treated with success.

    If you just want to test if your B2B is ready to accept messages over HTTP, then go to the URL above browser and make sure that you see below message-

    "B2B Server is ready to accept messages HTTP from the trading partner.

    Kind regards
    Anuj

  • How to get the Java instance variable in JSP custom

    Hello

    I decided to list some simple Java classes to use as instance variables. This should make it easier to do things with them in a JSP page since I know exactly what kind they are.

    My question is how to get my Java instance in the JSP page variable - I a screenflow with an Interactive component in what I would normally choose BPM interactive object call, but this allows BPM object instance variables not Java ones. So how can I associate my JSP custom?

    Thank you

    Neil

    In my view, that there must be a BPMObject that is passed into a JSP page. My suggestion would be to build a BPMObject as a "viewObject" with only the values you need and in the BPMObject constructor, load the java class data. And then possibly have a 'storeToJavaObj' method, you call after the JSP, which then stores the data to your java class if you wish.

    HTH...
    -Kevin

  • How to use the 'Get Shared Variable list' VI on a target RT?

    Hello

    I would like to browse all variables shared in a library hosted on my CompactRIO programmatically. I dropped the 'Get Shared Variable list' VI in my VI in real time, but when I tried deploying, LabVIEW says

    Deployment PRC_GetVarList.viPRC_GetVarList.vi loaded with errors on the target and was closed.
    LabVIEW: Unable to load the shared library dscProc.dll:ni_lvdsc_process_GetTagListEnd:C. ensure that the library is present on the target of RT. MAX allows you to install software from OR or FTP to transfer custom RT target libraries.
    LabVIEW: Unable to load the shared library dscProc.dll:ni_lvdsc_process_GetTagListBegin:C. ensure that the library is present on the target of RT. MAX allows you to install software from OR or FTP to transfer custom RT target libraries.

    I watched the wizard of the MAX software, but cannot find the DSC-based modules. Where should I look?

    Thank you!

    Hello

    The palette of DSC is not supported on the screws in real-time and will lead to errors when they are deployed.  Unfortunately, to have a successful build you will need to modify your application and remove the screws from the palette of DSC on your target of RT.

  • How to set the TMP/TEMP variables on account limited Vista's GUI?

    I have Vista64 Home Premium SP2.
    I would like to change the TMP/TEMP variables for my limited account in Vista.

    It is easy to do for the system account or my admin account
    (under advanced system environment variables,).

    But if I want to do the same thing on my limited account, UAC is triggered
    and the admin account variables are exposed, rather than limited.

    I then tried runas/user 'control sysdm.cpl', experiment /noprofile profile/env
    but the result is the same.

    I know that this is possible by editing the registry,
    But first of all, I would like to know MS medium to do so.

    BTW, as far as I KNOW, UNIX/Linux can have more intelligent way to elevation of privileges of the current user,
    instead of substituting another.

    HM, this seems to be the solution, it has not previously found.
    http://support.Microsoft.com/kb/931715/en-us
    http://www.Vistax64.com/Vista-account-administration/7649-setting-environment-variables.html

    Checked and use the setx command works.

  • How to call the property with variable

    Basically, I want to fill a table with data

    photoArray [count] = varLoader.data.nombre;

    the problem is that 'number' is supposed to be a variable is inside a loop and I "number ="peak"+ count;" before him, but it does not work, how do I call?

    table rating to coerce strings to objects:

    photoArray [count] = varLoader.data [number];

    or

    photoArray [count] = varLoader.data ["peak" + count];

  • How to access the static class variable calendar / singleton?

    How can I access a timeline of a static class variable / singleton?

    You can pass any object to display list to your class when instantiating it.  all objects in the display list has a placement property that allows access to the stage and them you can use the correct path/name to your variable.

  • How to control the Captivate 4 variable using Flash Action Script 3.0?

    Hi all.

    I'm working on Captivate 4.

    According to my requirement, I need to control externally Captivate system variables in Flash using the AS3 version.

    I found a script somewhere in the forums to control system in AS1 and AS2 variables. But I need them in AS3.

    "this._parent._parent._parent.rdcmndPause = 1;  "

    "this._parent._parent._parent.rdcmndresume = 1;  "

    I tried the same way in the AS3 version but could not do.

    It is an important condition for me.

    How to control variables in Flash AS3 Cp4?

    Kind regards

    Kartik.P

    Use the following code:

    MovieClip (this.root) .rdcmndPause = 1;

    MovieClip (this.root) .rdcmndResume = 1;

    This should solve your problem

  • How to assign the pl/sql variable to a variable of the page element?

    I want to select count (*) in the emp table.

    assign this count (*) total to a pl/sql variable.

    How can I assign this varialbe pl/sql variable of page element?

    : p2_test = pl_total;

    Thank you.

    Good afternoon

    Try this:

    1. create a process Page:

    Declare
    pl_total number;
    Begin
    select count(*)
    into pl_total
    from emp_table;
    :P2_test := pl_total;
    End;

    Or a simpler approach:


    Begin
    select count(1)
    into :P2_test
    from emp_table;
    End;

    If you use count (1) rather that count (*), you do the inventory column 1 and not the entire file. Oracle then reads just column 1 instead of the whole of the record, speed up your query, if the table can have a large number of columns AND a lot of files.

    Good luck
    Don.

    You can reward this answer by marking as being useful or correct :)

  • Custom device: how to change the channel icon in NI Veristand?

    Hello Board,

    I build peripheral customized for third-party product for my RT controller. They work well and properly. One thing that bothers me is: icon of the chain as shown in the figure below, with the red zone.

    How can I change the icon of the appropriate icon? Any help would be appreciated...

    Thank you!

    Rajamodol

    In the tags for an item, you can use the tag to configure a custom glyph to display for the item. You can use any PNG file as a glyph. As already mentioned a collection of glyphs that install with NI VeriStand is available at \System Explorer\Glyphs.

Maybe you are looking for