How to re-route source & gate for Buffered Period in DAmx

I am trying to write a DAQmx program that does the follow :
(1) creates 1 PulseTrain task; this task routes is output to a requested pin with will be used as a SOURCE for a Buffered Period task.
(2) if requested creates a second PulseTrain who's output will be used as the Buffered Period GATE.
(3) the Buffered period task needs to assign ANY SOURCE,GATE and run till its stopped by the user.
Note that this task needs to "sample/read" its data and show it to the user.
My questions are :
(a) is the PulseTrain "output" re-route done OK ?
(b) how to re-route the Period source/gate - I used DAQmxSetChanAttribute, but I an not sure it is right
©) how to make the Period task write the data into "my program buffer" so I do not have to read it when "stop" is pressed.
I try to run with simulated devices on a P4 3.2GHZ running XP :
First TrainPulse - ctr0, out->RSTI0
Second TrainPulse - ctr1, out->RSTI1
Period - ctr2, source=RSTI1, gate=RSTI0
Running this program with a SIMULATED device - OK (data = 0). with the real device - I get error -200141
I included my code.
Attachments:
DaQmx test.zip ‏147 KB

I have a new question
I need to create an event buffered task when the source=80mhz internal card timebase, gate=source of other counter (e.q for counter 1 use 0, for 3 use 2)
I know that with Traditional-DAQ it will look like )see attch file):
Now the convertion to DAQmx :
++++++++++++++++++++++++++++++
void SetupEvent(void)
if ( Internal.P6602_ID == -1 ) return;
sprintf(Chan,"Dev%d/ctr1",Internal.P6602_ID); // channel 1
DAQmxErrChk (DAQmxCreateTask("EventChan1",&DaqmxTasks.PCI_6602[1]));
DAQmxErrChk (DAQmxCreateCICountEdgesChan(DaqmxTasks.PCI_6602[1],Chan,"EventChan1",DAQmx_Val_Rising,0,
DAQmx_Val_CountUp));
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[1], DAQmx_SampTimingType, DAQmx_Val_SampClk) );
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[1], DAQmx_SampQuant_SampMode,DAQmx_Val_ContSamps) );
DAQmxErrChk(DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[1],DAQmx_SampQuant_SampPerChan, BUF_MAX));
// set source
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[1], DAQmx_SampClk_Src, "/Dev1/80MHzTimebase"));
// and gate
sprintf(msg,"/Dev%d/ctr0Source",Internal.P6602_ID);
DAQmxErrChk(DAQmxSetChanAttribute (DaqmxTasks.PCI_6602[1], Chan, DAQmx_CI_CountEdges_Term, msg,0));
sprintf(Chan,"Dev%d/ctr3",Internal.P6602_ID); // channel 3
DAQmxErrChk (DAQmxCreateTask("EventChan3",&DaqmxTasks.PCI_6602[3]));
DAQmxErrChk (DAQmxCreateCICountEdgesChan(DaqmxTasks.PCI_6602[3],Chan,"EventChan3",DAQmx_Val_Rising,0,
DAQmx_Val_CountUp));
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[3], DAQmx_SampTimingType, DAQmx_Val_SampClk) );
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[3], DAQmx_SampQuant_SampMode,DAQmx_Val_ContSamps) );
DAQmxErrChk(DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[3],DAQmx_SampQuant_SampPerChan, BUF_MAX));
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[1], DAQmx_SampClk_Src, "/Dev1/80MHzTimebase"));
sprintf(msg,"/Dev%d/ctr2Source",Internal.P6602_ID);
DAQmxErrChk(DAQmxSetChanAttribute (DaqmxTasks.PCI_6602[3], Chan, DAQmx_CI_CountEdges_Term, msg,0));
return;
Error:
Internal.StartStop = OFF;
if ( DAQmxFailed(error) ) DAQmxGetExtendedErrorInfo(errBuff,1024);
StopCallBack();
MessagePopup ("SetupEvent Error", errBuff);
return;
I am not sure this is the way to do it .
Can samebody help ?
Thanks, Galia
Attachments:
AutoScannerDAQCards.c ‏20 KB

Similar Messages

  • How to view the source code for Native Method

    hi
    i am using some native methods in to my code ;
    can anybody tell me how to view the source code for the same ;
    nik

    Buy/acquire a C/C++/assembly code disassembler and run the shared library through it.

  • How BOM and routing is selected for Planned order and Production order?

    Hi,
    Can any1 plz tell me how BOM and routing is selected for a planned order and production order. ?

    Hello Mathisuthan,
    BOM and Routing selection for the planned order and production order through production version, If u have more than one BOM and more than one Routing then u can maintain this information as Production Version in the system.
    Production version you maintained
    MM01/MM02 -- MRP4--- Production version
    Or you can create Production Versions in Mass also with Transaction Code "C223"
    In the case no production version maintained/created  for the material, then system by default  will pick the first BOM and routing.
    I hope this information helpful to you.
    Regards
    Umesh Mali

  • How to  Create  a selection variable for Fiscal period/year range

    How to  Create  a selection variable for Fiscal period/year range. The idea is to filter the query results using a fiscal period/year range user input rather than a full fiscal year input.

    Hi Priya,
    Open the query in a query designer -> in the left hand side you would find the fiscal year period under the time dimension -> right click -> create variable -> create the variable.
    The better option would be use any of the SAP provided variable. You would find them under the Fiscal year period in the left hand side in the query designer.
    Bye
    Dinesh

  • How to change the source type for a primary key on a form?

    Hi,
    At the time of creating a form, I had set the source type for the primary key to an existing sequence.
    Now I want to change the source to a trigger.
    Can anyone suggest how to do it?
    Thanks in advance,
    Annie

    Annie:
    Define the trigger and then delete the page process named 'Get PK'
    Varad

  • Is there any differnce between the Numeric Limit Test source code from TestStand 3.0 to TestStand 3.1? How to get the source code for the Numric Limit Test for both the versions?

    I need to know the differnece between the Numeric Limit Test between the TestStand version 3.0 to 3.1. If there is any differnec in the source code how to find it out? If somebody has the code can you share it?
    Thanks,
    Jeyan

    Hi,
    I don't believe there are any differences between the two versions. But you can check the source code for the Numeric Limit Test in TestStand\Components\NI\StepTypes\CommonSubsteps. But the main part of the step is the Code Module and this bit the users supplies this.
    What has prompted this question?
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How to get full source code for Oracle ADF?

    Hi,
    I 'm referring to the following URL http://download-west.oracle.com/docs/html/B25947_01/intro003.htm and it has mentioned that full source for Oracle ADF is available :
    "Full source for Oracle ADF is available to supported customers through Oracle Worldwide Support. The full source code for the framework can be an important tool to assisting you in diagnosing problems and in correctly extending the base framework functionality for your needs."
    Does anyone know how to obtain such information from Oracle support? Is this from metalink

    One possible snag in the process is that you will have some legal paperwork to sign. Depending on your company's policies, this could pose a problem.
    Erik

  • How to identify EBS Source tables for SC and OM modules?

    Hi,
    I need to identify EBS source tables for Supply Chain and Order Management module.
    What prefix I should check in EBS tables?
    Is there any document on this?
    Regards
    Sudipta

    Check etrm.oracle.com
    For order Management you should check with OE
    Purchasing PO and inventory INV and I guess for ASCP MSC
    Mahendra

  • Urgent: How to generate lo source images for slideshows?

    Hi everyone,
    I'm trying to generate low source images for my website, to reduce frustration for viewers downloading larger image files. In the past this has been easy to do one at a time, however I've got some slideshows on my website that are quite large and I'd like to be able to do the same for them. However, the low source auto generate button just generates a low source for the first image (the root source file of the slideshow) and not for any of the others. Is there a way to overcome this? Will it muck up the flow of the slideshow to have the low source images in the same folder with them?
    Thank you
    CJ

    Please can anyone help???

  • How to keep that valve open for certain period of time and shut off automatically

    Hi everyone,
    The objective of the VI is to measure pH and then open acid or base valve based on pH valve. Below is my UNFINISHED VI
    My question is:  if, for example, the  pH is 10, then, the program will open acidic valve for 5 seconds and then shut off automatically. After that, wait for 5 second. this process will go on and on as I use while loop, but I just dont know how to control the valve on for 5sec and off and then wait for 5sec.
    Anyone can help me out?    Thank you very much
    In the picture, please enter those values before running
    P.S The VI is based on previously posted vi by someone who made it 1 yrs ago.
    Attachments:
    project_trial_1_26.vi ‏27 KB
    Capture.JPG ‏79 KB

    1. The reason the valves close immediately is that the Elapsed Time VI does not cause any wait, it only measures the time. So the valves closed within a small fraction of a second of the time they opened.
    2. I modified your VI to wait until the Elapsed Time has ended.  See the "wait" state.  I probably modified some of your other functionality in the process, but this shows one way you could do the timing. 
    3. You do not need any Value property nodes.  They should never be used if the value can be wired directly.
    4. You do not need any sequence structures. Dataflow will determine the order of things occurring.
    5. If you use an enum for the state machine (and it is a good way to name and select states), you should make it a type def. Then when you need to change it as I did to add several states, you only need to change the Type Def in one place and the changes propagate through to every place you used the control or constants derived from it.
    6. I added a Halt state which will close both valves before stopping the program.  When you are controlling a real world process, it is important to consider the start up and shutdown requirements. For example the digital outputs of the USB-6008 default to inputs when the device is first powered up. And, the inputs are pulled high by a 4700 ohm resistor (at least I think I recall that value). Will this open your valves before the program starts running and sets the I/O lines to outputs and forces them low?
    The USB-6008 has rather limited drive on the digital lines. You will probably need a buffer between it and the valve coils.
    PID and PWM are more complicated than I want to get into here.  First, are your valves proportional or on/off? Second, (assuming that they are on/off) how fast can you open and close them without destroying them in the first week? What is their expected lifetime in terms of the number of operations? How fast do you need to be able to change them to keep your pH where you want it?  Are these values compatible?
    Lynn
    Attachments:
    pH State.ctl ‏12 KB
    project_trial_1_28.2.vi ‏66 KB

  • How to make a loop run for specific period of time ?

    hello !
    i'm new to labview and could'nt found how to make a loop run for 2 sec for example, and then to exit.
    Solved!
    Go to Solution.

    Hi Hookso,
    You can do it using the different loops like While loop and For Loop. Roderic has already stated how to do it using a for loop. I have illustrated in the attached vi how to do it using a while loop and Elapsed Time function. Take a look.
    Regards,
    Nitzz
    (Give kudos to good Answers and Mark it as a Solution if your problem is Solved) 
    Attachments:
    Untitled 2.vi ‏36 KB

  • How to create a 0FISCPER variable for [last period of current year]

    Hello,
    Can anybody tell me how to create a (exit) variable for the last period of the current year, based on 0FISCPER ?
    Based on a single value, user entry variable based on 0FISCPER.
    I did not find any standard (business content) variables for this.
    Can anybody tell me whether the following alternative works:
    variable 0P_BA102 (last period pervious year) with offset of +12 
    Kind regards.

    Hi,
    It should work.
    You can refer to the following link:
    http://help.sap.com/saphelp_sm32/helpdata/en/3f/89533e5ff4d064e10000000a114084/content.htm
    Regards,
    Amit

  • How to fetch last transactioned values for given period

    Hi,
    I'm working on a report, here I'm fetching data from j_2irg1bal table for some period. it has data to internal table like
    e.g. : given period 01-04.2009 to  30.04.2009
    date        mantr  opening balance closing balance
    04.04.2009  1007     100             130
    08.04.2009  1007     130              80
    here for given date two record are available,
    i need to capture last updated value i.e. for date 08.04.2009.
    Kindly suggest your ideas to move with this

    Hi,
    Assume that your values are in internal table ITAB.  Then,
    Sort ITAB by date DESCENDING.
    Doing so, your records gets sorted in Descending Order with respect to Date. And the Last updated record comes in the first position.
    And now,
    Read table ITAB index 1.
    The above code, fetches the last record into the Work-Area.
    That's it.
    Rgds,
    Ramani N

  • Router Source address for ACS Server

    Does anyone know how to configure a router(MSFC in this case so the same ip address is sent to the ACS server for authenticating. The source address may not always be the same depending on the path taken, If the source address isnt an ip address configured for one of my devices the acs server rejects the attempt and the router defaults to local login. I tried settigng a loopback address and always telnetiing to the loopback address however the source address from the MSFC is not the loopback I have 38 vlans, snd i suppose i could configure thoe ip addresses under a device, however if iI add a vlan then I must remember to add that vlan to ACS. Im sure there is a simpler way to address this, I just cant seem to find the configs needed on the MSFC to make it work.
    Any help will be greatly appreciated.
    Thanks

    Hi,
    Sounds like you need:
    ip tacacs source-interface interface-name
    (or ip radius source-interface interface-name)
    It's recommended to use a loopback interface, so this would give you (assuming loopback0):
    ip tacacs source-interface loopback0
    HTH - plz rate if it does
    Andrew.

  • How to change the source system for just a datasource

    Hi,
    Our test/development BI system ( BI 7.0 Unicode ) is connected to our development system and to our test system, 1 BI system connected to 2 R/3 systems.
    During some time, the test system won't be available so all datasources that point to the test system must be connected to the development system. In RSA1 is not possible to change the source system in a datasource: RSDS 057
    'Creation of DataSources for SAP source system D30CLNT007 is not permitted' , same error trying to copy the datasource,.
    Any idea about how to proceed ?
    Regards,
    Joan

    Hi,
    If I try to repliclate metadata in the datasource, message RSAR 051 appears: 'error when opening an RFC connection'. This error is expected because the logical system pointed in the datasource does not exist.
    Is not possible to change the source system in datasource ( in RSA1 ) because the field is always greyed, also if I try to copy the datasource the message RSDS 057 appears.
    Any idea about how to proceed ?
    Regards,
    Joan

Maybe you are looking for

  • AS3 oop problem

    I am a beginner with oop. Can anyone help me to understand what is wrong with this: public class MyClass{ //set some variables in constructor public function myMethod():void{ //my code myMethod(); The line that calls the function generates the error

  • Getting parseFloat to take things like "$1.0054e+10"

    Hi, I need to read in an excel file, some of the columns of which should be floating point numbers. The problem is that the format of the data in these columns can't be guaranteed, I may or may not get $ signs, I might get the 'e' exponential thing,

  • Java System Clipboard error implementing inhereted lostOwnership procedure

    I am trying to get a string from the system clipboard manipulate it then put the manipulated string back on the system clipboard. I'm fairly certain i have the accessing the clipboard correct, but i can't figure out an error i'm getting with part of

  • Opening External File with bookmarks

    Thank you for any help given. I have set-up 1 dropdown to filter info in to a second dropdown that when i select that item, it opens a new file over the top of the page. Great. The file that is being opened has been set to No Bookmarks "Page Only" &

  • Problem with MC13VD0ITM

    Hi all,    I'm trying to activate in LBWE the Billing Item extractor.  I get a short dump, and it tells me several fields are specified twice.  I do not see this in LBWE.  Can I remove the fields with SE11?  Or is there another solution?   Thanks. Da