Triggered finite acquisition and period measurement

Hello,
My problem is this: I'm not sure on how Labview accesses devices and how setting up multiple tasks affects loop iteration speed.
The vi I have attached uses a rotary encoder to generate a pulse triggering the acquisition. I have noticed that trying to also perform a period measurement on this pulse causes the iteration time to double. For that reason I have included the case structure so the program reads once every 50 iterations.
I am using the PCI 6250 (dev2) and PCI 6220 (dev1) which are connected by an RTSI cable. The 6220 and 6250 are connected to CB-68LP and TBX-68T terminal blocks respectively. The latter of which causes some problems due to incompatibility.
Any help on either te reasons for the slower iteration time and how to solve it would be most appreciated.
Thank you
Ingram
Solved!
Go to Solution.
Attachments:
new.vi ‏64 KB

Hi Ingram,
Thank you for your forum post and for including your VI. On reviewing your code I am aware of the following:
 Acquiring 3 Analogue Voltages using a PCI-6220 (Temperature and Torque readings)
 Acquiring 1 Analogue Voltage on the PCI-6250 which represents "Percentage Metallic Content", this task starts when a Trigger is recieved on PFI9
 Acquiring 1 Counter Input on the PCI-6220 which represents the RPM of a motor
You are also logging test data to a ASCII text file, this data is only logged when the user presses the stop button on the Front Panel.
As the Counter and Analogue input tasks are seperate from one another it would be worth placing them in their own loops, I think with a bit of rearranging we should also be able to avoid the scenario where you have a while loop embedded inside another while loop. The initialisation of the DAQ tasks should only really be performed once, outside any loops. Another issue dependant on how long the application is executed is the dynamic arrays that are being created, these could become really large slowing down the application the longer it is run for.
An architecture I would recommend for your application is "Producer/Consumer" outlined in the community example available here.
The producer loop will be acquiring data and runs really fast (High Priority), the consumer loop logs data to file (Low Priority), data is shared between the loops using a Queue structure, no other wires should be shared between the 2 loops as these might cause a data dependancy.
Do you require all 3 input tasks to be perfectly syncronized with one another?
Many Thanks
Jamie S.
Applications Engineer
National Instruments

Similar Messages

  • Triggered finite acquisition in a while loop - speed limit ? (newbi)

    Hello,
    I suppose the question already asked and answered but I didn't find exactly what I was looking for, so I'm sorry if it exists somewhere here.
    Usil LV7 with NI 4474 (PCI) acquisition board, PCI-6601 as external trigger, I would like to perform a repeted finite acquisition, starting on external trigger.
    Trigger is working fine (I need up to 20 impulses /s), but the finite acquisition in a while loop doesn't seem to follow the speed. I was thinking it was a CPU proble m and I removed everything which was not absolutely useful.
    So I have a VI with
    1) External trigger output. (express)
    2) While loop with DAQmx Read Analogic Waveform 1 channel N sample, with a DAQmx task as an i
    nput (specifying 50000Hz sample rate, 1000 samples, external trigger start)
    I was able to climb up to 10 cycles/s but above, some ext. triggers are missed.
    Question : where is the problem ? On continuous acquisiton, I can acquire up to 100.000 samples/s but on finite acquisition, I cannot perform 20x1000 samples/s ? What actually specifies the while loop itteration speed ?
    Thank you for your ideas, I'm joining VI capture...
    Attachments:
    vi_ai_external_triggered.JPG ‏31 KB

    I did not the test, but first of all, I think it is not the good way to call your task at each iteration. It is better to configure all elements concerning your aquisition outside the while loop. (external trigger, sampling rate, number of samples.... After you start the DAQmx read (only) in the while loop.
    I think you'd better start from an example from the labview library (attached file)
    Hope it will help you
    Regards
    Attachments:
    Acq&Graph_Voltage-Int_Clk-Dig_Start.vi ‏71 KB

  • I want to acheive digitally triggered data acquisition and using AIO lines for triggering connecting to PFI lines but no response.

    How to acheive digital data acquisitions using AO signals as trigger signal.

    Greetings,
    I am not sure that I have a clear understanding of your question. It appears that you want to perform a triggered acquisition. You mentioned both analog input (AI) and analog output (AO). Which type of operation are you performing? Are you using digital or analog triggering? Also, it would be helpful if you could mention what hardware and software you are using.
    Spencer S.

  • Exporting YTD and PERIODIC data

    Hi all,
    I've adjusted a data manager package so that the YTD and PERIODIC measures are automatically selected for export to a flat file. Whenever I want to save the package the script automatically changes and removes either YTD or PERIODIC.
    Any idea how I can change the script so that both YTD and PERIODIC measures are exported to a flat file?
    Thank you.
    DEBUG(ON)
    'PROMPT(SELECTINPUT,,,,"%DIMS%")
    PROMPT(SELECTINPUT,,,,"ENTITY,TIME,C_CATEGORY")
    'PROMPT(MEASURELIST,%MEASURES%,"Please select measures")
    'PROMPT(TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
    PROMPT(TEXT,%FILE%,"Please enter an output application file",)
    'PROMPT(RADIOBUTTON,%ADDITIONINFO%,"Add other information(Appset,Application,User,Time)?",1,{"Yes","No"},{"1","0"})
    'PROMPT(TEXT,%TYPE%,"Please enter the Process Chain Type",)
    INFO(%DIMVALUE%,E=24)
    INFO(%TEMPNO1%,%INCREASENO%)
    INFO(%TEMPNO2%,%INCREASENO%)
    INFO(%MEASURES%,YTD,PERIODIC)
    TASK(/CPMB/APPL_TD_SOURCE,DIMENSIONVALUE,%DIMVALUE%)
    TASK(/CPMB/APPL_TD_SOURCE,MEASURES,%MEASURES%)
    TASK(/CPMB/APPL_TD_SOURCE,OUTPUTNO,%TEMPNO1%)
    TASK(/CPMB/APPL_TD_SOURCE,SELECTION,"%SELECTION%DIMENSION:C_ACCT||DIMENSION:C_DATASRC|INPUT,INPUT_DIFF_ECCS,INPUT_ADJ,INPUT_GW,MJ_MANJE|DIMENSION:FLOW|F_999|DIMENSION:GROUPS|N_GROUP|DIMENSION:INTCO|I_TOTAL|DIMENSION:RPTCURRENCY|LC|")
    TASK(/CPMB/EXPORT_TD_CONVERT,INPUTNO,%TEMPNO1%)
    TASK(/CPMB/EXPORT_TD_CONVERT,TRANSFORMATIONFILEPATH,\ROOT\WEBFOLDERS\Company\LEGAL\DATAMANAGER\TRANSFORMATIONFILES\SYSTEM FILES\Export.xls)
    TASK(/CPMB/EXPORT_TD_CONVERT,SUSER,%USER%)
    TASK(/CPMB/EXPORT_TD_CONVERT,SAPPSET,%APPSET%)
    TASK(/CPMB/EXPORT_TD_CONVERT,SAPP,%APP%)
    TASK(/CPMB/EXPORT_TD_CONVERT,OUTPUTNO,%TEMPNO2%)
    TASK(/CPMB/TD_APPL_SERVER_TARGET,INPUTNO,%TEMPNO2%)
    TASK(/CPMB/TD_APPL_SERVER_TARGET,FULLFILENAME,/interface/BIP/BPC_export/%FILE%)
    TASK(/CPMB/TD_APPL_SERVER_TARGET,ADDITIONALINFO,1)

    Sgt. Rock wrote:
    Should I just break down and buy server space to exchange complete files?
    This the way I do with my co-work production or when work in a team with guys who live out of my country. You can pack/archive the whole project folder into Zip or (Rar - I do that using my PC) which reduces the project folder content globally.
    There are quite many "free hosts" in our days so you can manage your work via Email or Skype and use such servers if you can not afford to buy any hosting space. To my opinion it is best to provide the original project when you use same apps, plugins etc. Any tricky export, audio file compression etc will be time consuming for your partner...
    !http://img59.imageshack.us/img59/4967/aglogo45.gif!

  • Triggering and simultaneous measurements

    Hi everybody 
    I've written a Vi to to acquire data simultaneously from 7 devices. I'll be using cDAQ9178 with NI9203. The vi will acquire current values 4 to 20mA. Could you please check the attached file and let me know if I need to improve it.
    I have some question and I should be grateful if anyone can help me to answer them.
    1. How to open the binary file from write to measurement file by EXCEL?
    2. Is it better to use write to spreadsheet for data logging, if yes how to include the time column??
    3. I'm going to use external signal for triggering through PIF0 port, is it Ok to do that through dag assistance?? I've not tried yet but it seems straightforward?
    4. Finally I have another vi for valve control that should be triggered with the measurement vi, is their any way to do that?? I was thinking about notifiers but I don't know how to use them ?
    Sorry for asking to much  I really in urgent need of all of this. I should finish my data acquisition system by Tuesday 
    Best Regards 
    Solved!
    Go to Solution.
    Attachments:
    triggering and simultaneous measurements.vi ‏97 KB

    1. How to open the binary file from write to measurement file by EXCEL?
    If you select TDMS as the file format in the write to measurement file, you should be able to open it directly from Excel if you install the TDMS Excel Add-In. Be aware that at 1kHz data rate, you will exceed the capability of old versions of Excel to read the entire file in about 65 seconds. Newer versions can read more, but anything over a couple thousand points gets difficult to analyze. That is about my limit. Over this, I go to something else for analysis, such as LabVIEW or Mathematica.
    2. Is it better to use write to spreadsheet for data logging, if yes how to include the time column??
    The write to spreadsheet file is very inefficient for data logging and cannot be recommended. Given your data (an array of waveforms), TDMS is your best bet. The write to measurement file Express VI is the easy way to do this. I, personally, prefer the control I get from using the TDMS API directly. Note that under the hood, the output of the DAQ Assistant is an array of waveforms with individual t0s and dts. The t0s are all different due to the fact that your 9203 is a scanned device, not a simultaneously sampled device. It scans at 200kHz, so the differences are not large, but they are there. I would convert the DDT into an array of waveforms, then use the native TDMS API, but I have a lot of experience. Since you are in a hurry, the Express VI using TDMS is probably your best bet.
    3. I'm going to use external signal for triggering through PIF0 port, is it Ok to do that through dag assistance?? I've not tried yet but it seems straightforward?
    That should work fine. Given your continuous acquisition, the trigger will only start the acquisition, not gate it or trigger it at later times.
    4. Finally I have another vi for valve control that should be triggered with the measurement vi, is their any way to do that?
    We do not have enough information to answer this question. Specifically, how is the valve being triggered (boards being used, hardware interface, software interface). The ideal way would be to run it through the same cDAQ 9178 so that it can be synchronized through hardware. Software synchronization cannot be guaranteed better than about ±50ms. Read up on how to synchronize things through DAQmx and you should be good.
    Good luck!
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Doing Data acq. and buffered period measurement using counters simultaneously, gives an buffer overflow error

    Iam doing Data acquisition using NI-PXI 4472 and buffered period Measurement using NI-PXI 6602 simultaneously,my program gives an buffer overflow error

    murali_vml,
    There are two common buffer overflow and overwrite errors.
    Overflow error -10845 occurs when the NI-DAQ driver cannot read data from the DAQ device's FIFO buffer fast enough to keep up with the acquired data as it flows to the buffer (i.e., the FIFO buffer overflows before all the original data can be read from it). This is usually due to limitations of your computer system, most commonly the result of slow processor speeds (< 200 MHz) in conjunction with PCMCIA DAQ boards, which have small FIFO buffers (e.g., the DAQCard-500). Sometimes using a DAQCard with a larger FIFO can solve the problem, but a better solution is to lower the acquisition rate or move to a faster system. Another cause of the -10845 error could be due to an interrupt-driven
    acquisition. For example, PCMCIA bus does not support Direct Memory Access (DMA). If the system is tied up processing another interrupt (like performing a screen refresh or responding to a mouse movement) when it is time to move data from the board, then that data may get overwritten.
    Overwrite error -10846 occurs when the data in the software buffer that you created for an analog input operation gets overwritten by new data before you can retrieve the existing data from the buffer. This problem can be solved by adjusting the parameters of your data acquisition, such as the lowering the scan rate, increasing the buffer size, and/or increasing the number of scans to read from the buffer on each buffer read. Additionally, performing less processing in the loop can help avoid the -10846 error.
    See the NI-DAQ Function Reference Manual for a listing of all NI-DAQ error codes.
    Have a great day.

  • Measure Pulse Width and Period Statistics

    Hello,
    I'm trying to solve what should be a very simple problem. I would like to measure common characteristics of a binary analog voltage input, pulse width and period. The canned pulse width/duty cycle/period VIs and express VIs use a histogram or peak to peak method on a set buffer size of data and produce one output. I would like to measure these signal characteristics over a long period of time and collect statistics on pulse width and period data (max, min, median, mean, standard deviation, etc.) to indirectly measure the eccentricity of a system. Although I am relatively inexperienced in LabView scraping off a considerable bit of rust, I did not think this task would present a challenge, but I have been stumbling around for a couple of days trying to create an array of output parameters such as pulse width so that I may calculate the statistics on all measurements.
    If anyone can step me through some of the thought process to a solution or show me how to format data collection so that this can be done, I would very much appreciate the help.
    Thanks,
    Evan
    Attachments:
    Example.jpg ‏194 KB

    Hi Gena,
    I am assuming you are using the DAQmx drivers in LabVIEW for your
    PCI-6014.  Avoiding a While loop may be difficult if you need to
    perform this measurement many times and you might not know when the
    signal is going to begin.  Without a While loop, you'll have to
    set up your timeout period long enough so the pulses will begin before
    your VI stops.
    With this in mind, you may want to look at some of the shipping
    examples with the DAQmx driver.  You can find these in LabVIEW's
    Help menu by going to Find Examples.  For measuring the pulse
    width, browse the folders in the Example finder by going to Hardware
    Input and Output>>DAQmx>>Counter Measurements>>Period
    or Pulse Width.  In this folder, there is the Meas Pulse Width.vi,
    which measures the pulse width once and stops.  You should be able
    to take the pulse width measurement you get from here and check to see
    if it's in your range, then output a pulse on the other counter if it
    is in the range.  The pulse output examples can be found in
    Hardware Input and Output>>DAQmx>>Generating Digital
    Pulses>>Gen Dig Pulse.vi.
    Thaison V
    Applications Engineer
    National Instruments

  • Pulse/Period measurement to control VI

    Hi
    I am enquiring regarding controlling a vi iterations with an external trigger. Let me summarise my VI first.
    I have a for loop using single point aquisition i need to run for a specific number of iterations depending on the time base between my external trigger (this is approx. 1-3 seconds). This is located in a while loop containing a number of other data manipulation including limit testing etc. The reason i am using single point rather than buffered is that i need to display the data in RT and (from my knowledge) i can't get the buffered aquisition to do this, or even waveform AI to do it either.
    I have used the measure period VI in labview to obtain a time in either s or ms within the while l
    oop and passed this to my for loop to iterate x times.
    The problem is (which actually makes sense!) when the while loop runs it must recieve two pulses from the external trigger before it can pass a number to the for loop. The result of this is that i lose sequences (a sequence is the data occuring between the pulses).
    The VI does exactly what i want BUT the timing is all wrong.
    What i need the VI to do is capture the time between ALL the pulse sequences, so that when the VI reiterates, the number of times the for loop must iterate is already in place. I have tried buffered pulse measurement but can't seem to get it to work as i think it should.
    Any ideas? It is kinda difficult to explain this exactly in writing but any solutions appreciated.
    R

    Ross,
    There are definitely different ways of doing this. The way you have done this in your VI will work; however, there are drawbacks. First, each time you call the AI single point VI, it performs a configuration, which takes time, so you're doing this 4 times every loop. This slows down your readings.
    A better way is to scan all four channels at once, and then read them all at once, saving the time to configure every loop. Even better than that is to run a buffered acquisition, and read the most current data out of the buffer.
    Therefore, I would propose taking a look at an example in the LabVIEW directories for a Continuous Scan example. It will show you what VIs you need to set up the acquisition. Then, there will be a while loop w
    hich reads the data. What you'll need to do is look at the inputs of the AI Read VI. There's an input to tell it where to get the data. If you set it to "Relative to the end of the buffer", and tell it to get 1 point, you'll get the most up-to-date point for all 4 channels. Then you can combine the channels to get your plot, just as you are now, and you can look to see if your trigger happens.
    Second, when the trigger does occur, you can do an AI Read outside of that loop and read the ENTIRE buffer, to get ALL of the points. These will be at whatever scan rate you set up, but they will be nice and evenly spaced, not determined by the loop time. So, in this manner, you can still get real-time updates of what's happening, but your scan rate can be higher than the loop time, and you'll still get all the data. Got it?
    If you need an example to demonstrate how to do this, I'd be glad to show you.
    Mark

  • PXI 6229 pulse period measurement

    Hi there,
    I try to make pulse period measurement using PXI 6229 counter, I have 0.5Vcc according to DMM and 1.05V peak2peak based on scope. Then, I connected 0.5Vcc (incoming pulses) into SCB68 pin 3 and GND pin 55. I used the DAQ assistant to perform measurement n the setting for Signal Input range is min= 1ms and max = 23ms, those values I got it from scope i.e pulse period. I set it to the Rising and Acquisition Mode to 1 sample(on demand). But, I can’t get the measured values and I have no ideal why?
    Please help
    Walter.

    Hi Walter,
    the counter input of the PXI-6229 accepts standard TTL digital signals. You can find its specifications on page 7 of this document.
    I will repeat the relevant parts here:
    Input high voltage: Min: 2.2 V; Max: 5.25 V
    Input low voltage: Min: 0 V; Max: 0.8 V
    If I'm correct, your signal does not meet these specifications, so in this case you will have to connect the signal to an analog input and measure the pulse width as if it was an analog signal.
    Please check this page for an example.
    Daniel

  • Synchronisation between an Acquisition and a Timer

    Hello,
    I work with LabView 6.i, with a DAQ-device type PCI 6040E and a block-connector type SC-2345. I have the following problems: First one, I want to synchronise an acquisition AI (1000 Hz, 16 channels) with a timer generation (Counter 1), and second one, I want to acquire (Counter 0) synchronously like a NI-TIO-based device.
    I want to know every millisecond the number of pulses I get at the source pin of Counter 0, so I use the Counter 1 to generate a 1000 Hz square signal which I put at the gate pin of the Counter 0 and then I count the number of impulses I get at the source pin of the Counter 0. Moreover, this countering must be synchronised with my acquisition.
    1)     To solve my synchronisation problem, I looked at examples in the help of LabView like the Simul AIAO BufTrig(E-series) and tried to do the same as shown but I am not sure whether I have to wire “hardwarely” the PFI0-line with any signal or if it is done internally. Where can I find information about hardware-wiring of trigger signals ?
    2)     To solve my synchronous countering, I also looked at examples in the help of LabView and I read in the description of the VI Counter Set Attribute that it is not possible to count synchronously with my DAQ-device, it is only possible with NI-TIO-based devices. I want to know how many impulses I get every second at the source pin of the Counter 0. If I select for the task type of the VI Group Config the task Buffered Event Counting, it sums the number of impulses and it is not what I want, and if I select for the task type of the VI Group Config the task Buffered Period Measurement, it counts the number of impulses I get every millisecond but if I do not get any impulse during a millisecond, it takes automatically the previously impulse number and it is also not what I want. I want to know the number of impulses I get every second but also if I do not get any impulse, it should give me the number zero !
    Answer accepted in French, German or English. Thanks for your help.
    Riri

    Hallo,
    du solltest Dir überlegen ein Upgrade zu machen. Ab der Version LabVIEW 7, gibt es eine neue Treiber-API namens DAQmx, diese ist sehr viel ausgereifter und es gibt viel mehr Beispiele und sie ist einfacher zu programmieren. Des weiteren ist es für mich schwierig dies zu supporten, da ich LabVIEW 6 nicht mehr auf dem Rechner habe. (LV 7.1, LV 8 und LV 8.2 reichen auch).
    Aber ein Multifunktionscounter hat weniger Eigenschaften wie ein TIO-Counter. Aber wie gesagt ein Upgrade würde sicher gut tun!
    Grüsse
    Alex

  • How to club the downpayment and periodic billing scenario in Sales Order

    Hi experts,
    Could you please let me know how to club the downpayment and periodic billing scenario in Sales Order.
    Requirement is :  If you have 10 lacs total amount and out of that 50% should be the downpayment and rest of the amount should be distributed among three equated  instalments for 2 months each (periodic billing). This should work with one line item in sales order. Pls provide relevant inputs how to work out this scenario.
    Your help would be appreciable.
    regards....Diwakaran

    Hi Yang,
    Workflow is the best approach for any issue related to business objects.
    Since you want call FM BAPI_SALESORDER_CHANGE, it will change SO. It means everytime any SO is changed there will an event being triggered.
    object type: BUS2032
    event: Changed
    simple solution:
    1. Please create object type (SWO1) and its super type should be BUS2032.
    2. Add your own method and attach your custom FM which actually updates the qty & PR)
    3. Create Task (PFTC_INS)
    in basic data:
    - provide object type which you have created
    - provide method which you have added
    goto triggering events tab
    - Choose Object Category as BOR object type
    - provide object type (better give BUS2032)
    - provide event as CHANGED
    Please have look into very nice video blog which helps you to create your workflow.
    blog: [Creating your first SAP Business Workflow]
    Regards,
    Sukhbold Altanbat.

  • Example Vi's For Voltage and Period

    We have just recieved a couple of DAQCard-AI-16XE-50 cards and Labview. I
    am trying to find an example vi showing how to combine hardware timed voltage
    input and period calculation in the same loop.
    Basically I want to record volages from a couple of strain gages and two
    RPM pickups. I am using the period vi instead of the frequency vi because
    I don't want to tie up both counters on one input.
    Thanks for any help,
    Christopher Quijano

    Be sure you have DAQmx drivers installed. Then you can find many prepared examples in Help -> Find Examples, where you can browse to Hardware Input and Output -> DAQmx -> Counter Measurements. Here you can find many examples - you just need to specify the board you use, and connect signals properly to terminal block.
    If you are looking for how the frequency measuremen is made, then I recommend you to see M Series User Manual (or E or X Series), Chapter 7 - Counters, section Counter Input Applications, part Frequency Measurement.
    if anything doesn't work, it would be useful to specify what board do you use, what drivers you have installed and what you try to implement.
    regards,
    stefo

  • -10920 error when executing buffered period measurements on a PCI 6602 timer.

    I frequently encounter the -10920 NI-DAQ error when I run the C code for single buffered data period measurement .
    The error message is "One or more data points may have been lost during buffered period measurements due to speed limitations of the system". I am unable to resolve this error. I have a Win2K environment and am using VC++ to compile and execute the code. Please help.

    When doing buffered period measurements, the rate at which you can transfer data from the counter is system dependant. To try to get around this there are two things you can try. The first is to set the 'number of counts to read at a time' to a greater number. This way, the 6602 board will use less calls across the PCI bus. If possible, try to limit the number of pulses coming in on the gate that you are using to latch the counts, though in many applications this is not possible.
    Make sure that you minimize the PCI bus activity on your computer. This includes, video activity and any network activity along with anything else that is connected to the PCI bus.
    Brian

  • DAQmx period measurement- buffer is cut when frequency is too high

    Hello,
    I'm using the DAQmx period measurement in order to measure a low frequency pulses. Even though the average frequency is low I still sometime get two pulses that arrive within a short time . When that happens I get  an error message and the buffer is cut. I'm wondering if there is any way to ignore one of the pulses (in the case that the pulse arrives at a time that is too short for the program to read) and for the measurement to keep running until the buffer is full??
    Thank you ,
    Shafran

    Hi all, thanks for your help.
    I'll give more details:
    1. I'm using PCI-6602
    2. The error code number I'm getting is:  200141       Possible reason(s):
                                                                                         Data was overwritten before it could be read by the system.
    3. I'm measuring photon emission from biological samples where each photon is converted to a pulse of a 35.2 ns width. I can control the concentration of the sample and therefore the average frequency of the pulses. I have started with an average intensity of 100 kHz and I went down to 10kHz. My final goal is to run the period measurement program in loops where I decide the buffer size so each loop will take approximately 10 seconds. The problem is that even if one out of all the buffers is cut all my calculations after that are wrong. A filter sounds like the perfect solution for my problem (I need to find out more about that option).
    4. I have checked the limitations of the program and I know that it can't measure pulses that arrive at a higher frequency than a few MHz, therefore I assume that even at an average frequency of 10kHz I still get some pulses that arrive within a frequency of a few MHz.
    Thanks again for all your help. I hope I didn't bore you with to many details...
    Shafran    

  • BPC 75NW YTD / Periodic Measure query

    The Application is currently set to YTD. The Inputs are therefore done on YTD level for Costs. Headcount is a statistical account with AST account type, so YTD/Periodic measures become irrelevent.
    Now, What I need is Periodic Costs  Divided by HC to get Cost/HC (Cost_HC_Centre) and this is the script that I am running:
    *SELECT (%BUS%, "[ID]", BUSAREA, "[CALCULATION]=Y")
    *FOR %YEAR%=2011,2012
    *FOR %MONTH%=JAN,FEB,MAR,APR,MAY,JUN,JUL
    *FOR %BA%=%BUS%
    *RUNALLOCATION
    *FACTOR=1/USING
    *DIM CATEGORY WHAT=ACTUAL; WHERE=<<<; USING=<<<
    *DIM TIME WHAT=%YEAR%.%MONTH%; WHERE=<<<; USING=<<<
    *DIM DATASRC WHAT=INPUT; WHERE=<<<; USING=<<<
    *DIM FLOW WHAT=F_999; WHERE=<<<; USING=<<<
    *DIM CURRENCY WHAT=INR; WHERE=<<<; USING=<<<
    *DIM COSTCENTER WHAT=[BUSAREA]="ADM_%BA%"; WHERE=<<<; USING=NO_COSTCENTER
    *DIM PROCESS WHAT=NO_IO; WHERE=<<<; USING=BAS(%BA%)
    *DIM ACCOUNT WHAT=BAS(Salary_and_Benefits); WHERE=Cost_HC_Centre; USING=HC
    *ENDALLOCATION
    *COMMIT
    *NEXT
    *NEXT
    *NEXT
    By doing so, it is calculating it as YTD Cost / HC where I need Periodic Cost / HC
    Please let me know how can I achieve the same.
    Thanks.

    Is measure formula for PERIODIC working as expected ?If not ,you might need to calculate periodic values and store in PERIODIC  measure . and then use periodic measure in the logic.

Maybe you are looking for