Visual C++ AM/FM generation using NI-6062E & DAQmx C functions

hi all,
I am trying to write my own code in VC++ .Net(MFC) for FM/AM generation using DAQmx C functions, but it was more demanding than on the LabView platform. I can build the framework for all parameters (ie. Carrier Freq, Modulation Freq, Modulation Index, Amplitude) but as I came to the the array size, sampling rate, buffer size, I don't know what to do??
Can anyone please have a look?
Thank you very much!
Attachments:
NI_AM_FM.zip ‏60 KB

Hello Sean,
The following code is where I think most important to my task of AM/FM generation:
(Ln147 to Ln162 in FunctionGenerator.cpp)
void CFunctionGenerator::GenerateSineWave(
CNiReal64Vector& waveform,
double frequency,
double amplitude,
double sampleClockRate, // samples/sec.
double samplesPerBuffer)
double deltaT = 1/sampleClockRate; // sec./samp
int intSamplesPerBuffer = static_cast(samplesPerBuffer);
waveform.SetSize(intSamplesPerBuffer,CNiVector::NiVectorDoNotInit);
for(int i=0;i waveform[i] = amplitude * ::sin( (2.0 * M_PI) * frequency * (i*deltaT) );
I want to change the waveform 1D array to something like this for FM:
waveform[i] = amplitude * ::cos(((2.0 * M_PI)*carrier_frequency*(i*deltaT)) + modulation_index*sin((2.0 * M_PI) * modulator_frequency * (i*deltaT)));
for AM:
waveform[i] = amplitude * (1 + modulation_index * cos (( 2.0 * M_PI) * modulator_frequency *(i*deltaT))*cos((2.0 * M_PI)* carrier_frequency *(i*deltaT)));
It seems I need to add two more parameters "double frequency_modulator, double modulation_index," to the GenerateSineWave function,
but it also looks like I need to adjust the "for(int i=0; i < intSamplesPerBuffer; i++)" because from my LabView Block Diagram iteration of "i" also depends on the two frequency parameters?
Do I also need to adjust deltaT? or the sampleClockRate is not fixed in FM/AM cases?
How can I do the above?
Thank you for your patient.
Regards,
RollyMessage Edited by Rolly on 04-06-2005 02:35 PM
Message Edited by Rolly on 04-06-2005 02:38 PM

Similar Messages

  • Problem for xml generation using DBMS_XMLGEN

    Hi All,
    i have problem during xml generation using Any help would be highly appreciate
    how could we publish xml data using data base API DBMS_XMLGEN in oracle applications (APPS) i.e. at 'View Output" using
    Any help would be highly appreciate.
    Let me know if need more explanation, this is High priority for me.
    Thanks and Regards,
    [email protected]
    Message was edited by:
    user553699

    You can set the null attribute to true , so that the tag appears in your XML
    see the statement in Bold.
    DECLARE
    queryCtx dbms_xmlquery.ctxType;
    result CLOB;
    BEGIN
    -- set up the query context
    queryCtx := dbms_xmlquery.newContext(
    'SELECT empno "EMP_NO"
    , ename "NAME"
    , deptno "DEPT_NO"
    , comm "COMM"
    FROM scott.emp
    WHERE deptno = :DEPTNO'
    dbms_xmlquery.setRowTag(
    queryCtx
    , 'EMP'
    dbms_xmlquery.setRowSetTag(
    queryCtx
    , 'EMPSET'
    DBMS_XMLQUERY.useNullAttributeIndicator(queryCtx,true);
    dbms_xmlquery.setBindValue(
    queryCtx
    , 'DEPTNO'
    , 30
    result := dbms_xmlquery.getXml(queryCtx);
    insert into clobtable values(result);commit;
    dbms_xmlquery.closeContext(queryCtx);
    END;
    select * from clobtable
    <?xml version = '1.0'?>
    <EMPSET>
    <EMP num="1">
    <EMP_NO>7499</EMP_NO>
    <NAME>ALLEN</NAME>
    <DEPT_NO>30</DEPT_NO>
    <COMM>300</COMM>
    </EMP>
    <EMP num="2">
    <EMP_NO>7521</EMP_NO>
    <NAME>WARD</NAME>
    <DEPT_NO>30</DEPT_NO>
    <COMM>500</COMM>
    </EMP>
    <EMP num="3">
    <EMP_NO>7654</EMP_NO>
    <NAME>MARTIN</NAME>
    <DEPT_NO>30</DEPT_NO>
    <COMM>1400</COMM>
    </EMP>
    <EMP num="4">
    <EMP_NO>7698</EMP_NO>
    <NAME>BLAKE</NAME>
    <DEPT_NO>30</DEPT_NO>
    <COMM NULL="YES"/>
    </EMP>
    <EMP num="5">
    <EMP_NO>7844</EMP_NO>
    <NAME>TURNER</NAME>
    <DEPT_NO>30</DEPT_NO>
    <COMM>0</COMM>
    </EMP>
    <EMP num="6">
    <EMP_NO>7900</EMP_NO>
    <NAME>JAMES</NAME>
    <DEPT_NO>30</DEPT_NO>
    <COMM NULL="YES"/>
    </EMP>
    </EMPSET>
    http://sqltech.cl/doc/oracle9i/appdev.901/a89852/d_xmlque.htm

  • Can I use the NI DAQmxbase C functions to develop a Smart Device application using a NI USB or NI ENET 9234 C module with Visual Studio for an iMX31 (ARM 11) embedded computer running Win CE 5.0 or 6.0?

    I have an embedded application running on a iMX31 (ARM 11) that does fairly high performance analog input (24 bit, 50K samples/second).  I use Microsoft Visual Studio 2005 C/C++ for the develoment environment and have currently built versions of the application for Win CE 5.0 and 6.0 without Labview or NI hardware.  I have used the NI 9234 with great success on several Labview applications in the past and I'd like to use the 9234 on this embedded application with VS2005 C/C++. The NI documentation hints that I should be able to do this (maybe I'm overly optimistic) and I'm wondering if anyone else has?   I've tried the Evaluation versions of Labview Mobile and Labview Touch panel to build a C application using the NI DAQmx base C function inside Visual Studio without success.  I can compile and link the ContAcq IntClk LV example project for an x86 platform using NIDAQmx but not for a ARM platform using NIDAQmxbase.lib.  I get the same linker error   error LNK2019: unresolved external symbol referred to in Knowledge Base Document ID 4HAEE7QQ  even though I've set up (or think I've set up ) VS2005 as the KB article indicates.
    If anyone has used the C functions and NIDAQmxbase library inside a VS2005 Smart Device project, I'd greatly appreciate your comments.
    Thanks 

    Hello Gene,
    I have been checking into this for you and have found out that what you are trying to do cannot be done.  At least not in the current manner you are hoping for.  The internal architecture of DAQmx Base requires the cross-compiling capability of the LabVIEW Mobile Module. While a stand-alone compiler can compile DAQmx Base calls for desktop processors, it cannot compile DAQmx Base calls for ARM.
    If your application requirements exclude the LabVIEW toolchain, then the remaining option is the USB Driver Development Kit which is avaliable here, but you will have to contact your local field sales representative to discuss support
    options as standard phone and e-mail support are not available for the
    NI Measurement Hardware DDK. 
    NI Measurement Hardware Driver Development Kit
    http://digital.ni.com/express.nsf/bycode/exyv4w?opendocument&lang=en&node=seminar_US
    ColeR
    Field Engineer

  • SAP RF/ Bar code generation using IM

    Hi folks
    Can any one experiencing in using SAP Console / Bar code generation using Inventory Management .

    Please read this article
    http://tdworld.com/info_systems/highlights/peak-pepco-inventory-management/
    Is it possible to generate the barcoding using Handling unit or any other module without WMS ?
    Thanks for your input
    Jeevan

  • Recently my text won't visually show up when I use the text tool. Help!

    recently my text won't visually show up when I use the text tool. Help!

    Provide the name of the program you are using so a Moderator may move this message to the correct program forum
    This Cloud forum is not about help with program problems... a program would be Photoshop or Lighroom or Muse or ???

  • What is the best user guide for my ipod touch 2nd generation using ios 4.2.1?

    I have a second hand ipod touch 2nd generation using ios 4.2.1, this is my first mobile apple device and I want to read up on it this weekend but the guides seem to be for devices running ios3 on 2nd gen or 4.3 on 3rd+ gen, none for 2nd gen with ios4.    is there one i haven't found or should I read the ios3 guide then the ios 4.3 guide?

    And here is a video that someone else did walking through some of the features on a 2nd gen:
    http://www.youtube.com/watch?v=sr1jYOMyQhU

  • Is there any way to change waveform generation using formula with user defined formulas

    Hi,
    I need to build a VI that has in input a formula (Exen(w*t)) and output a waveform.
    The waveform generation using formula.Vi that comes with labview has Defined formulas and theu are not dinamic I don't want that.
    I try to change with a text control but VI dont generate the graph.
    Can someone help me with this please?
    Best regards
    Ricardo
    Attachments:
    test.vi ‏18 KB

    Hello.
    If you want to change your formula with a textbow, you can use the Eval Formula Node.vi if you have a full version of LabVIEW.
    see http://digital.ni.com/public.nsf/allkb/C5DBAA3A788​271EE86256B02007DD6B3?OpenDocument
    Best regards

  • I am trying to configure some new unsupervised iPod touch 4th generation using Apple Configurator but it won't give me the option to install the app that appears on the Apps tab.

    I am trying to configure some new unsupervised iPod touch 4th generation using Apple Configurator but it won't give me the option to install the app that appears on the Apps tab. I have tested the to see whether it works in supervised mode and it does but in Prepare mode it won't let me tick the box.
    Any ideas anyone?
    Many thanks
    Mario.

    The requirments say:
    Requirements: Compatible with iPhone 3GS, iPhone 4, iPhone 4S, iPad 2 Wi-Fi + 3G, and iPad Wi-Fi + 4G.Requires iOS 5.0 or later.
    No mention of iPod touch
    http://itunes.apple.com/app/jack-boxer/id530122469?mt=8

  • HT204409 Can't determine my location with my iPad 3rd generation using Wi-Fi??

    Hi there,
    Can't determine my location with my iPad 3rd generation using Wi-Fi??
    I did all the common troubleshoots as reboot the device, check if it works with other devices (checked with iPad 4th generation works fine)...elc.
    Please Advice.

    Wifi-only iPads do not do a good job of finding location. Their location depends on the location of the wifi router they are connected to being registered in an online database. If you wnat better location results you need an iPad with GPS (iPad wifi +3G) model.

  • Pivot Table generation using ABAP code

    Hi Friends,
                  Could you please anyone help me to get the functionality of generating Pivot table in Excel from SAP.
    and let me know how to use the structure EXCELPIVOT.
    I am very greatful if anyone get me for this.

    Hi ,
             Here is the code.
    -->  p1        text
    <--  p2        text
    FORM fill_xxl_interface .
      xmpl_header1 = text-048.
      PERFORM fill_xmplt_o.
      PERFORM fill_xmplt_p.
      PERFORM fill_xmplt_v.                " online text
      PERFORM fill_xmplt_s.
      PERFORM fill_xmplt_h.
      PERFORM xxl_list_output.
    ENDFORM.                    " fill_xxl_interface
    *&      Form  fill_xmplt_o
          text
    -->  p1        text
    <--  p2        text
    FORM fill_xmplt_o .
      DATA:
          info1(40),
          info2(40),
          ival1(60),
          ival2(60).
      info1(40) = text-049.
      info2(40) = text-050.
      WRITE sy-datum TO ival1.
      WRITE sy-uname TO ival2.
      xmplt_o-line_no    = 1.              " Text which can be displayed
      xmplt_o-info_name  = info1.          " \ online in the list viewer
      xmplt_o-info_value = ival1.          " \ is defined here.
      APPEND xmplt_o.                                           "#EC *
      xmplt_o-line_no    = 2.
      xmplt_o-info_name  = info2.
      xmplt_o-info_value = ival2.
      APPEND xmplt_o.                                           "#EC *
    ENDFORM.                    " fill_xmplt_o
    *&      Form  fill_xmplt_p
          text
    -->  p1        text
    <--  p2        text
    FORM fill_xmplt_p .
      DATA:
        ptxt1(60),
        ptxt2(60),
        ptxt3(60).
      ptxt1(20) = text-051.                " SAP R/3   XXL Listviewer
      ptxt2(20) = text-052.                " Programmplanung
      WRITE sy-datum TO ptxt3.
      xmplt_p-hf         = 'H'.                                 "
      xmplt_p-lcr        = 'L'.            " left position
      xmplt_p-line_no    = 1.                                   "
      xmplt_p-text       = ptxt1.
      APPEND xmplt_p.                                           "#EC *
      xmplt_p-lcr        = 'C'.
      xmplt_p-line_no    = 2.
      xmplt_p-text       = ptxt2.
      APPEND xmplt_p.                                           "#EC *
      xmplt_p-lcr        = 'R'.
      xmplt_p-line_no    = 1.
      xmplt_p-text       = ptxt3.
      APPEND xmplt_p.                                           "#EC *
    ENDFORM.                    " fill_xmplt_p
    *&      Form  fill_xmplt_v
          text
    -->  p1        text
    <--  p2        text
    FORM fill_xmplt_v .
      vtxt1 = text-004.                    " Production Line
      REPLACE ';;' WITH ' ' INTO vtxt1.
      vtxt2 = text-007.                    " Year
      REPLACE ';;' WITH ' ' INTO vtxt2.
      vtxt3 = text-024.                    " Month
      REPLACE ';;' WITH ' ' INTO vtxt3.
      vtxt4 = text-026.                    " Material
      REPLACE ';;' WITH ' ' INTO vtxt4.
      vtxt5 = text-022.                    " Material Description
      REPLACE ';;' WITH ' ' INTO vtxt5.
      vtxt6 = text-028.                    " Dosage Form
      REPLACE ';;' WITH ' ' INTO vtxt6.
      vtxt7 = text-047.                    " Dosage
      REPLACE ';;' WITH ' ' INTO vtxt7.
      vtxt8 = text-009.                    " Units per Pack
      REPLACE ';;' WITH ' ' INTO vtxt8.
      vtxt9 = text-036.                    " Manufacturing Stage
      REPLACE ';;' WITH ' ' INTO vtxt9.
      vtxt12 = text-092.                   " Order Number
      REPLACE ';;' WITH ' ' INTO vtxt12.
      vtxt13 = text-093.                   " Start Date
      REPLACE ';;' WITH ' ' INTO vtxt13.
      xmplt_v-col_no     = 1.
      xmplt_v-col_name   = vtxt1.
      APPEND xmplt_v.                                           "#EC *
      xmplt_v-col_no     = 2.
      xmplt_v-col_name   = vtxt2.
      APPEND xmplt_v.                                           "#EC *
      xmplt_v-col_no     = 3.
      xmplt_v-col_name   = vtxt3.
      APPEND xmplt_v.                                           "#EC *
      xmplt_v-col_no     = 4.
      xmplt_v-col_name   = vtxt4.
      APPEND xmplt_v.                                           "#EC *
      xmplt_v-col_no     = 5.
      xmplt_v-col_name   = vtxt5.
      APPEND xmplt_v.                                           "#EC *
      xmplt_v-col_no     = 6.
      xmplt_v-col_name   = vtxt6.
      APPEND xmplt_v.                                           "#EC *
      xmplt_v-col_no     = 7.
      xmplt_v-col_name   = vtxt7.
      APPEND xmplt_v.                                           "#EC *
      xmplt_v-col_no     = 8.
      xmplt_v-col_name   = vtxt8.
      APPEND xmplt_v.                                           "#EC *
      xmplt_v-col_no     = 9.
      xmplt_v-col_name   = vtxt9.
      APPEND xmplt_v.                                           "#EC *
      xmplt_v-col_no     = 10.
      xmplt_v-col_name   = vtxt12.
      APPEND xmplt_v.                                           "#EC *
      xmplt_v-col_no     = 11.
      xmplt_v-col_name   = vtxt13.
      APPEND xmplt_v.                                           "#EC *
    ENDFORM.                    " fill_xmplt_v
    *&      Form  fill_xmplt_s
          text
    -->  p1        text
    <--  p2        text
    FORM fill_xmplt_s .
      DATA: n      TYPE i,                                      "#EC NEEDED
            col_no TYPE i.                                      "#EC NEEDED
      CLEAR: xmplt_s, n.
      DO n_vrt_keys TIMES.
        ADD 1 TO col_no.
        PERFORM line_xmplt_s USING col_no 'STR' 'DFT'.
      ENDDO.
      DO 6 TIMES.
        ADD 1 TO col_no.
        PERFORM line_xmplt_s USING col_no 'NUM' 'ADD'.          "CO 589334
      ENDDO.
    ENDFORM.                    " fill_xmplt_s
    *&      Form  LINE_XMPLT_S
          text
         -->P_COL_NO  text
         -->P_1708   text
         -->P_1709   text
    FORM line_xmplt_s  USING     col_no
                                col_typ
                                col_ops.
      xmplt_s-col_no     = col_no.
      xmplt_s-col_typ    = col_typ.
      xmplt_s-col_ops    = col_ops.
      APPEND xmplt_s.                                           "#EC *
    ENDFORM.                    " LINE_XMPLT_S
    *&      Form  fill_xmplt_h
          text
    -->  p1        text
    <--  p2        text
    FORM fill_xmplt_h .
      PERFORM line_xmplt_h USING 1 1 text-012.
      PERFORM line_xmplt_h USING 1 2 text-014.
      PERFORM line_xmplt_h USING 1 3 text-016.
      PERFORM line_xmplt_h USING 1 4 text-019.
      PERFORM line_xmplt_h USING 1 5 text-030.
      PERFORM line_xmplt_h USING 1 6 text-033.
    ENDFORM.                    " fill_xmplt_h
    *&      Form  line_xmplt_h
          text
         -->P_1      text
         -->P_1      text
         -->P_TEXT_012  text
    FORM line_xmplt_h  USING     row_no col_no text.
      xmplt_h-row_no     = row_no.
      xmplt_h-col_no     = col_no.
      xmplt_h-col_name   = text.
      APPEND xmplt_h.                                           "#EC *
    ENDFORM.                    " line_xmplt_h
    *&      Form  xxl_list_output
          text
    -->  p1        text
    <--  p2        text
    FORM xxl_list_output .
      DATA slines TYPE i.
      DESCRIBE TABLE xmplt_s LINES slines.
      n_att_cols = slines - n_vrt_keys.
      SORT t_final BY year month dispo.
      CALL FUNCTION 'XXL_FULL_API'                              "#EC *
        EXPORTING
          filename          = 'XXLPB001'
          header_1          = xmpl_header1
          no_dialog         = space
          n_att_cols        = n_att_cols
          n_hrz_keys        = 6
          n_vrt_keys        = n_vrt_keys
          sema_type         = ' '
        TABLES
          data              = t_final
          hkey              = xmplt_h
          online_text       = xmplt_o
          print_text        = xmplt_p
          sema              = xmplt_s
          vkey              = xmplt_v
        EXCEPTIONS
          cancelled_by_user = 1
          data_too_big      = 2
          dim_mismatch_data = 3
          dim_mismatch_sema = 4
          dim_mismatch_vkey = 5
          error_in_hkey     = 6
          error_in_sema     = 7
          file_open_error   = 8
          file_write_error  = 9
          inv_data_range    = 10
          inv_winsys        = 11
          inv_xxl           = 12
          OTHERS            = 13.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.                    " xxl_list_output
      Data declarations for 'XXL_FULL_API'                               *
    DATA: xmpl_header1 TYPE gxxlt_p-text.
    DATA BEGIN OF xmplt_o OCCURS 0."#EC *     " Internal tables which shall be
            INCLUDE STRUCTURE gxxlt_o."#EC *   " \ used as input into the function
    DATA END OF xmplt_o.                   " \ module's table parameters,
    " \ are defined with reference to
    DATA BEGIN OF xmplt_p OCCURS 0."#EC *    " \ the appropriate DD structures.
            INCLUDE STRUCTURE gxxlt_p.                          "#EC *
    DATA END OF xmplt_p.
    DATA BEGIN OF xmplt_h OCCURS 0.                             "#EC *
            INCLUDE STRUCTURE gxxlt_h.                          "#EC *
    DATA END OF xmplt_h.
    DATA BEGIN OF xmplt_v OCCURS 0.                             "#EC *
            INCLUDE STRUCTURE gxxlt_v.                          "#EC *
    DATA END OF xmplt_v.
    DATA BEGIN OF xmplt_s OCCURS 0.                             "#EC *
            INCLUDE STRUCTURE gxxlt_s.                          "#EC *
    DATA END OF xmplt_s.
    DATA: n_att_cols TYPE i,
          n_vrt_keys TYPE i VALUE '11'.

  • Change pulse width in a continuous generation using an array of High/Low Times using NI-DAQmx

    Hi,
    I'm using a PCI 6259 (M-Series) Multifunction DAQ, and I want to use a counter to output a pulse train with changing low times. I want to use this output signal as an update clock, where values of Digital Output Channel, and the Analog Output channels updates to new values sequentially in the order specified in their repective 1D arrays in the front panel. I want the updates to happen at every rising edge of the clock pulse. The times when I want this update to happen are also user-specified by an 1D array of times in the front panel. So I'm trying to configure one couter to output this changing width pulse train.
    I'm new to Labview/Ni DAQ. I'm using NI DAQmx, so far its been really nice and readable, and easy to understand. Even though I have never used NI-DAQ, I can clearly see that NI DAQmx is certainly much more programming friendly than NI-DAQ. I looked at the VI's available in the example, and also through many simlar posts in these Forums, and some web documents for my problem. Most of the solutions have focussed on changing times on the fly while the application is running. I want to specify the different times before a "DAQmx Start Task" is called. I'm wondering wether this is possible.
    I was hoping I could store the pulse width values in a buffer, and the counter could keep outputing pulses with different widths in one continuous operation. The M-Series help file says that it is possible to do that "seamlessly", but I dont see yet how I can use the NI DAQmx to do that. Attatched is the part of the Help file where it says that.
    Any help will be greatly appreciated.
    Attachments:
    Counter_Change_Frequency_Help.pdf ‏21 KB

    Hi Kevin,
    Thanks for your message. Well, I would like to point you to the 'DAQmx Timing' vi, which has an instance for change detection applications with digital input. I'm new to LAbview, but I'm wondering wether you can use that for your applications. Yes, I have seen the Viewpoint boards and their programs.. I have actually also looked into their Vi you are talking about, Kevin, for ideas to use with my board, but the core of the program is in C, which is something I would use as a last option, specially since I bought Labview to make life easier.
    To get back to the subject of my post, their is a vi 'DAQmx Write", and one of its instance is 'Write Counter Single Channe SINGLE Sample', and there is no 'Multiple Sample" option available for writing counters, as is for the Digital Ports and Analog Outs. That seems to be a bit surprising. To refer the following example
    http://zone.ni.com/devzone/conceptd.nsf/webmain/90DFE241E571056C86256FA4004ABB63
    (pulse width modulation with NI-DAQmx)
    If one can change values of pulse widths on the fly, I would assume thats it should also be possible to pre-define a sequence of pulse width values in a buffer from which the counter 'banks' can access the next pulse width from. ('Banks' are the 2 load register pairs for the counters and is described in the part of the M-series help file attatched in my earlier post).
    Hopefully somebody from NI can address our problem. And yes Kevin, currently I have 2 options,... 1. to create a digital waveform before hand, which will use a large buffer ( I want an experiment to run for 1s, with 0.1us timebase, or
    2. To use the example in the above web document and modify it a bit. Here frequency is changed on the fly, and a while loop checks if the frequency is changed in the at regular intervals. I could instead use a for loop to keep changing the frequency values, but I tend to think that the speed will be limited by software. I'm not sure .. I haven't tries that out yet.
    Hopefully someone can send me a nice elegant solution.
    Thanks.
    Shomu

  • I am trying to write a double buffered data acquisition program using MFC and a callback function.

    i am trying to do a double buffer data acquisition using MFC application framework in Visual Studio.i want to use a callback function to notify when the buffer is half full.do you have some sample reference program that can help me?

    What DAQ board are you using? When you installed NI-DAQ you should have selected to install the support files for VC++. Then there will be several examples on how to do double buffered data acquisition.
    If you have already installed NI-DAQ 6.8 or higher and did not select to include the support files, you can run the NI-DAQ setup program and just add them. If you are using an older version, you will have to uninstall and reinstall.
    Once you have the support files, follow this path to the examples.
    >>Program Files>>National Instruments>>NI-DAQ>>Examaples>>Visual C>>
    If you are doing digital acquistion, goto the di folder, if you are doing analog acquisition goto the ai folder.
    As for the callback function, you can use the NI-DAQ function Config_DAQ_
    Event_Message with DAQEvent Type = 1, where N would equal half your buffer.
    Brian

  • Controlling NI2568 Switches using VB6 and DAQmx

    Can the NI-2568 (and similar) switches be controlled using VB6 and DAQmx?
    I got the impression from the "NI-DAQmx C API VIsual Basic 6.0" Help, that by using the "Digital Output API ",  it could be done very similarly to opening/closing a discrete , but no samples were included.
    I just need to close a few relays and don't know if I have to install the "NI-Switch" software or not.
    If it can be done, what would be the channel string to pass to the DAQmxCreateDOChan dll function
    (in place of "Dev<x>/Port<y>/Line<z>").  MAX shows my (simulated-don't have the hardware yet) switch device to be "PXI1Slot3" .
    Thanks,
    Jon 

    Hi Jon,
    You can also use NI-DAQmx Switch functions to control PXI-2568 rather using NI-SWITCH (NI-SWITCH installs ready-made VB examples)
    You can use functions such as
    DAQmxSwitchSetTopologyAndReset, DAQmxSwitchCloseRelays, DAQmxSwitchOpenRelays to control individual relays in PXI-2568. ANSI C Examples for DAQmx switches can be found at C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Switches. This can be used to write VB 6 code. Refer to  using "C Examples to create VB 6.0 Applications" in C:\Program Files\National Instruments\NI-DAQ\Docs\cvb60daqmx.chm for help on converting C examples to VB 6.0.
    Kalyanramu Vemishetty
    Automated Test Systems Engineer
    National Instruments

  • How can I use Automator to toggle the Function Keys?

    I am trying to create a Automated process to toggle the Function Keys on my keyboard. This is because I use several programs, including After Effects, which use the F1-12 keys, but when I am not using that program I commonly use the Apple-defined shortcuts on the keyboard. I have a full-sized keyboard, hence no Fn key. So that's out right away – I've read several comments on this topic where people suggested that this is the ONLY option. I refuse to beleive that.
    Automator contains a "Watch Me Do" feature, which I have tried to use to record this process. Problem is, it never clicks the right object. If I record clicking the dock, the magnification (I suspect) throws off the virtual-controlled mouse and picks the wrong object. If I record the Apple Menu route, it gets it about 1/2 the time.
    I think what I'm really looking for is a console command I can feed into the Terminal which toggles the keys. It seems to be that this HAS to be an option, even if it is more than one line of commands. I believe if I can feed this process into Automator, it would work.
    Any ideas?
    Thanks in advance, Mac Geniuses!

    iKey lets you define function keys per application. You seem to want to turn on & off the defined apple keys.  Not sure if these keyboard re-mappers will do the trick.
    Here is my other most favored application. Of course, I haven't checked these out in newer OS's. I'm a Tiger man myself.
    iKey is a front end program that simulates typing and mouse movements. I use iKey to remap the Function keys.
    "iKey is an automation utility, a program that creates shortcuts to accomplish repetitive tasks. In essence, an iKey shortcut is a little program in its own right, but you don't need to know the first thing about programming to create an iKey shortcut. All you have to do is put together three necessary parts of a shortcut: One or more commands that give the shortcut its functionality, a context in which it runs, and a launcher that defines how the shortcut is activated."
    http://www.scriptsoftware.com/ikey/
    iKey  has a little more function then the previous free version called youpi key. For many years, I used youpi key before switching to iKey.  It works fairly well for me in MAC OS 10.4 although not officially supported.  The youpi key download is hard to find & no longer here.
    http://www.versiontracker.com/dyn/moreinfo/macosx/11485&vid=75326
    ( Send me a message for a copy of youpi  key. )
    *Examples:*
    I have the common programs that I use assigned to function keys. I have F4 assigned to Firefox. When I want to start FireFox, I press F4. When I want to switch to firefox, I press F4! Starting & switching to an application in Mac OS are the same thing in Mac OS.
    Here is an example of to assign volumn control to a function key.
    http://discussions.apple.com/message.jspa?messageID=10361085#10361085
    Here is my script for listing my application folder. I have it assigned to function-key 6.
    tell application "Finder"
       open folder "Applications" of startup disk
       select Finder window 1
       set bounds of Finder window 1 to {-3, 44, 691, 545}
       --set position of Finder window 1 to {33, 44}
       set position of Finder window 1 to {60, 45}
       activate
    end tell
    The second portion of this script was generated in the script editor record mode. After I recorded the script and did some editing, I copy the script to ikey/youpi key.
    Full Key Codes
    http://download.cnet.com/Full-Key-Codes/3000-2094_4-44175.html
    Spark
    "Spark is a powerful, and easy Shortcuts manager. With Spark you can create Hot Keys to launch applications and documents, execute AppleScript, command iTunes, and more... You can also export and import your Hot Keys library, or save it in HTML format to print it. Spark is free, so use it without moderation!"
    http://www.versiontracker.com/dyn/moreinfo/macosx/22675
    Mac OS X remap or rename keyboard keys
    by vivek
    So how do you remap or rename keyboard keys under Mac OS X?
    Simply use DoubleCommand software.  It is a free program
    http://theos.in/apple/download-doublecommand-to-remap-keyboard-keys/
    Keyboard Maestro is a powerful macro program for Mac OS X (including Tiger and Leopard) which has received glowing reviews. Keyboard Maestro will take your Macintosh experience to a new level in “Ease of Use”. With Keyboard Maestro you can design a custom action sequence with your own shortcuts and use them at any time, you can navigate through running applications and open windows with Program Switcher, and you can work with an unlimited number of clipboards - all by pressing simple keystrokes.
    http://www.keyboardmaestro.com/main/
    "Spark is a powerful, and easy Shortcuts manager. With Spark you can create Hot Keys to launch applications and documents, execute AppleScript, command iTunes, and more... You can also export and import your Hot Keys library, or save it in HTML format to print it. Spark is free, so use it without moderation"
    http://www.versiontracker.com/dyn/moreinfo/macosx/22675

  • How to use a mysql built-in function with dataprovider

    hi.
    I want to use a mysql built-in function, for example, MD5() on a column when updating a table with dataprovider.
    Something like this doesn't work:
    MyDataProviderOne.setValue("tablename.field_name", "MD5('some text')");
    How should it be done?
    thanks.
    Mike.

    hi.
    thanks. this helped, but I'd like to use also different functions, that's why, I'd rather do it by MySQL built-in functions with dataprovider... Is there any way to do that?
    best regards.
    Mike.

Maybe you are looking for

  • Jpeg preview icons are jagged in the Finder

    I'm going through my images, archiving some, tossing others. I've come across a folder full of jpeg images where the icons are so jagged you can't see what the image is. Most of my other jpeg preview images are okay, and when I Get Info (from Finder)

  • How do I install viewsonic drivers?

    I need to figure out how to control brightness on a new Viewsonic display! Their website lists no Mac drivers, and the interface I'm getting through Sys Preferences gives me almost nothing.

  • Audit archive path

    Where do I modify the audit archive path for the Audit Log Management job. Also, how to I Delet old job logs. Thank you, -Lilach

  • Problem with dual grafic

    i've palivilion 14 n037tx dual grafic intel and Amd radeon but when I install driver for Amd Radeon witn HD 8670m always have trouble. Amd radeon undetected when I install game on grafic Aplication like Photoshop CS6 or CorelDraw X5 event I have chan

  • Officejet Pro K550 won't manually duplex

    My Officejet K550 used to manually duplex. Now it prints all pages continuously, even though the "reload paper" window appears on the screen! I am using Windows Vista Home Premium, the latest version, with all updates. Thanks, in advance, for any adv