How can I implement 'WaitCommEvent' in VISA for RS232?

I am trying to use VISA to control my RS232 device as a beginner.
I would like to know how I can implement a fuction 'WaitCommEvent' of VC++ in VISA. The usage is as follow(You can check it in MSDN):
WaitCommEvent(hFile, lpEvtMask, NULL);
The function waits until any event happens in RS232. For example, if a character is available in buffer, the function stop.
If I open RS232 connection with CNiVisaSession, what corresponds to 'hFile?.' Or, how I can implement the function in VISA?
Thank you very much.

Hi,
One option for you here that could be very easy is to set the timeout for a very large value, then just make a read call to the serial port. The function will not return until the timeout completes or when you receive the data. You may need to play with the termination character and the number of bytes you read depending on the data that you expect to read.
Make sure that you take a look at the examples that ship with MStudio.
I hope this helps.
Regards,
Juan Carlos
N.I.

Similar Messages

  • How can i implement the default value for this variable?

    In one of our Stored procs,we have a variable RECS_TO_DELETE, which determines the number of records to delete from various DELETEs that happen within this proc.
    The value for RECS_TO_DELETE variable should be obtained from a configuration table sys_config
    select
    rec_num into RECS_TO_DELETE
    from sys_config
    where
    sys_code=55;
    But if something goes wrong with sys_config table or the above SELECT INTO, our client wants to makes sure that RECS_TO_DELETE should have a default value of 1000.
    In the code, how will i implement having this default value of 1000 for RECS_TO_DELETE variable  in case the above SELECT INTO fails for some reason.

    Hi,
    You have to assign a value before the execution...
    DECLARE
        RECS_TO_DELETE NUMBER(9) := 1000;
    BEGIN
        SELECT rec_num
        INTO   RECS_TO_DELETE
        FROM   sys_config
        WHERE  sys_code = 55;
        DBMS_OUTPUT.put_line(RECS_TO_DELETE);
    EXCEPTION
        WHEN NO_DATA_FOUND THEN
           DBMS_OUTPUT.put_line(RECS_TO_DELETE);
    END;
    /Regards,

  • How can I implement my vision for my website?

    Hello, I'm having a lot of trouble reaching my goals for my website using Muse. I do love Muse, it's allowed me to lauch pozzswim.ca and get some content up which I would have never been able to do before having no coding knowledge, but it's is only about 30% as functional as I want it to be.
    My vision:
    There are 2 sections to my site which the current version of muse would make very difficult to do: a blog and a news page. I want these two things streamlined and hassle free so I can upload new content on the fly as it happens no matter where I am.
    If a user were to navigate to my /video-blog.html page what I want them to see is a neat, chronologically organized view of the blogs I've done with a breif description and a thumbnail. Clicking on the blog title/thumbnail/description will take the user to a new page with the full blog and the video from youtube I've uploaded for it plus a section for comments using livefyre and links to other blogs. There will also be a headline on my homepage with the most recent 2 or 3 blogs I've done.
    If a user were to navigate to my /news.html page they would see a well organized chronolgical view of all my news items. My news items are usually short updates and links and won't require their own pages but will need to be formatted in an easy to digest way. I would also have a headline on the homepage for the most recent news items.
    The homepage headlines should update automatically as I post things, and blog pages and news articles should be able to be created without me having to do everything manually in Muse.
    Implementation:
    I'm sure this is possible, but how can I do this and still use Muse to design my site? I know it requires a content management system, but how can I integrate one into the static content created by Muse? Options I've looked into are wordpress, joomla, and business catalyst but how do I use those with what I already have?
    I could just create a pure wordpress site, but that would mean leaving Muse and the design freedom it gives me and learning a whole new system which I wouldn't have time for. Business Catalyst I wouldn't be too thrilled about as I would have to pay 3 times the hosting cost to get their blogging features plus I would have to migrate and I like my current host.
    So how can I do this?
    Thanks for your time and support
    -Andrew

    CRM, including blogs, is currently supported on Muse, but they are working on it. Meanwhile, you can try to integrate a blog into Muse. See more information:
    http://forums.adobe.com/message/4605983#4605983
    Here is a short video explaining how to integrate a blog
    https://my.adobeconnect.com/_a295153/p6wv1sik1gq/?launcher=false&fcsContent=true&pbMode=no rmal

  • HT1918 plz i want help , how can i use credit card visa , im try to fill blank no. card information when i finish appear me msg ( the payment card you entered is not valid in israel p;ease provide avalid payment card for israel , im from palestine ) plz s

    plz i want help , how can i use credit card visa , im try to fill blank no. card information when i finish appear me msg ( the payment card you entered is not valid in israel p;ease provide avalid payment card for israel , im from palestine ) plz solutio?

    Oh thank god i am not the only one with this problem. It started with me on Saturday (aug 28) and still, no solution.
    I live in the border with the USA so i’ve been using my itunes account with a USA debit card and then it started with that **** declined CC problem =S
    The funny thing is that i’ve been trying to change countries, setting my account to Mexico and it would still say that the CC are declined. Tried 2 USA cards and 2 Mexican cards, no results =S
    Wanna read something funny. I even tried to create a brand new account based in Mexico, with another email address and it still wouldn’t let me, tells me my cards are not valid……..the **** apple!!! i cannot update any app and i just got my iphone 4 on friday last week and i am dying to try new apps.
    So far I’ve sent 2 emails and still no **** solution. At least i am not alone =’(

  • We have a requirement to print the w2 forms for employees using java application, how can i implement this. Please give some suggestion.

    We have a requirement to print the w2 forms for employees using java application, how can i implement this. Please give some suggestion.

    Anyone any ideas to help please?

  • How can I implement IMAQ correlation for 16bit image?

    Hi
    When using IMAQ correlate. vi in Machine vision Filter catergory, the vi only works for 8 bit source and template image case.
    16 bit source image case makes error.
    But I need 16 bit source image without losing image information, I want to use full 16 bit image correlation with 8 bit template.
    How can I implement the code in labview?
    Need help.
    Many thanks.

    Unfortunately you can't do so.
    There are some functions in the Vision Lib that only accept 8bit images. In order to use them you have to convert your image to an 8bit Image.
    Keep in mind that converting an Image to 8bit will not necessary result in a loss of data. Check your Images, it might be that you are not using the full range of a 16bit value. you might be able to use a mixture of dynamic shifting and bit shifting in order to convert an image to an 8 bit, then embedding these criterias in the image and use them to convert back to a 16bit at a later time without losing any data, or in most cases minimal precision loss. 
    If you would like to attach one of the images you are using, I can take a look at it to see if this is possible in your case.
    Good luck,
    Dan,
    www.movimed.com - Custom Imaging Solutions

  • How can I make a "property node" for a VI?

    Hello!
    If I add a boolean button on the FP then I am able to make a property node for that button in the Block Diagram. But how can I make a property node for a VI? I have several VI:s an that together is one program. What I need to do is to verify what kind of VI some of my VI:s is. I need to verify if it is .exe or .vi-file, and if it is .exe then I want to disable run, abort, run continuously bottons otherwise not. I have hard that this is possible to do programmaticaly but I can´t figure out how. I am aware that I could do that manually in the File->vi properties->customize->windows appearance but theese choises makes it last forever.
    I want to be able to stop and run and everything if it is a .vi file, but if it is .exe-file then all those buttons should be disabled.
    Anyone have an example on this?
    In an other message at this Forum I read "You can use the `Front Panel Window. Allow Runtime PopUp`" property to disable run-time shortcuts menues programmaticaly, but still I dont know how to create this property node.
    /Amir

    You really shouldn't open a new thread. If you don't understand something, ask and we will explain it.
    Like I said in the other thread, you can check if you are running in LV or an EXE by using the Application>>Kind property. To get it, place a property node (from the Application Control palette) on the diagram, click it and find the property.
    To set the properties for the VI, place another property node, right click it and select Select Class>>VI Server>>VI. You should have the properties you want under Front Panel Window.
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf). I believe chapter 17 of the user manual explains about programmatic control of VIs.
    Try to take over the world!

  • How can I implement a new protocol over IP

    Hi,
    I want to implement a new protocol (my customized one) in solaris 8. This protocol will be something like UDP and will be using IP for communication.
    So how can i use IP stream module for that?
    thankx
    prasenjit

    I can give you some pointers regarding this. Although, I implemented protocol below IP.
    - Look for information on ipsecah and ipsecesp. These are pseudo devices on top of IP for Solaris 8.0.
    - Check how the protocol stack is built while booting.
    - If you intend to implement a module, rather than a driver then things might be little easy. You can push your module on top of IP. See man for "sad" and "autopush" mechanism
    - Sample drivers and modules from SUN are of great
    help. I came to know about the sample drivers very late.
    Otherwise, I would have saved some time.
    - Unix System V network programming by Rago is a very good reference.
    I hope this helps.
    -Ashutosh

  • How can I implement a Digital I/O counter with a maximum source frequency of 80 MHz (like 6602 board) using CompactRIO?

    How can I implement a Digital I/O counter with a maximum source frequency of 80 MHz (like 6602 board) using CompactRIO? It appears as if the Digital I/O modules for CompactRIO are much slower than this.
    Thank you,
    --Ray

    Hi Ray,
    The highest frequency input we offer for C Series modules is 20 MHz if you are doing LVTTL and 10 MHz for 5 V TTL.  These modules are the 9402 and 9401, respectively.  Unfortunately, there is no 80 MHz input on this form-factor.
    Regards,
    Chris E.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • How can I implement an user function in a derived column of a report ?

    Hello,
    I've a report and added a derived column.
    In this column should be displayed the result of a function.
    GETANZGJMONATE ( to_date(#START_AFA#,'DD.MM.YYYY'), #ND#, :P302_GJ );
    How can I implement this?
    Thanks in advance
    Regards Ulrike

    Ulrike - I would do this in the SQL statement (there may be other ways).
    Presumably START_AFA and ND are table columns?
    Presumably you've also created the GETANZGJMONATE function?
    So, something like this should work (this also assumes that START_AFA is of a DATE type - you'll need the TO_DATE call if not):
    SELECT COL1
    , COL2
    , START_AFA
    , ND
    , GETANZGJMONATE (START_AFA, ND, :P302_GJ)
    from TABLE
    where ...
    Can't remember if you have to grant any particular execute permissions on the function ('grant execute on GETANZGJMONATE to public', for example) when you call it from SQL on a page, but you could try that if the function call fails.
    Depending on what's in :P302_GJ and what the function parameter data type is, you might need to use the '&P302_GJ.' syntax or TO_NUMBER etc.
    Hope this helps.
    Regards,
    John.

  • How can i implement 'Distribute Qty' function in BAPI_GOODSMVT_CREATE

    Hi all,
    Using MIGO For GR. if more than one Batch or Production Date or Vendor Batch for same Purchase Order Line Item and Deliv date, need to hit ‘Distribute Qty’ button to split the entry line into multiple lines before enter Production Date and Vendor Batch.
    So I want use bapi BAPI_GOODSMVT_CREATE  implement MIGO function for a interface. Anyone have some suggestion how can i implement the 'Distribute Qty' function in the bapi.
    My email address: [email protected]

    Hello,
    1. Use structure BAPIPAREX for passing custom fields. (There are several blogs/posts on how to make use of this).
    2. In the BAPI i noticed there is a BAdI to populate these fields into your business tables.
    Call BAdI MB_BAPI_GOODSMVT_CREATE to fill own fields
        TRY.
            get badi lo_mb_bapi_GOODSMVT_CREATE.
          CATCH cx_badi_not_implemented.                    "#EC NO_HANDLER
        ENDTRY.
        TRY.
            call badi lo_mb_bapi_goodsmvt_create->extensionin_to_matdoc
              EXPORTING
                EXTENSION_IN = EXTENSIONIN[]
              CHANGING
                CS_IMKPF     = S_IMKPF
                CT_IMSEG     = T_IMSEG[]
                CT_RETURN    = return.
          CATCH cx_badi_initial_reference.                  "#EC NO_HANDLER
        ENDTRY.

  • How can we implement the currency translation in a query definition

    How can we implement the currency translation in a query definition and should it modified for each and every type of currencies

    hi rama krishna
    i think u can not get any translation in Query. this is only for het the report as it is there in tables. if u want to write a report take a help of the Abaper
    hope u goit,assign points if u ok for this
    thanks
    subbu

  • How can I implement the connection pool in my java stored procedure

    my java stored procedures (in database 'B') have to connect to another oracle database ,let's say 'A'. And how can I implement the behavior like the so-called connection pool in my java stored procedure in 'B', as below.
    1. database B, has 2 java stored procedures sp1 and sp2
    2. both sp1 and sp2 connects to databse 'A'
    whatever I call the sp1 and sp2 and the database 'A' always only one connected session from sp1 and sp2 in database 'B'.
    THANKS A LOTS...

    my problem is I have a lots of java stored procedures need to cnnect to the remote oracle db, and I hope the remote db can only have a connected session from my java stored procedures in my local db. I try as below
    class sp{
    static Connection conn=null; //the remote db connection,
    public static void sp1(){...}//procedure 1, using conn
    public static void sp2(){...}//procedure 2, using conn,too
    I can 'see' the 'conn' variable if I invoke the sp1() and sp2() from the same client application(maybe sqlplus). But if I invoke the sp1() from client 'A' and invoke sp2() from client 'B' then the sp1() and sp2() can not see the 'conn' variable for each other. I think it's because the two clients cause oracle to create two instances of the class 'sp' and the sp1() and sp2() located in different instance seperately. Thus the sp1() and sp2() can not see 'conn' for each other. They can only see its own 'conn'.
    To connect to the remote db from the java stored procedure is easy but is it possible to connect to the remote db via database link from the java stored procedure at my local db ? If so, then I also archive my goal .
    BTW , thanks a lots...
    andrew :-)

  • How can I implement Authentication in LDAP

    How can I implement Authentication in LDAP.

    Hi,
    If ur using JAAS, then use NTLoginModule in ur conf file and your own defined CallbackHandler for validating and obtaining the Subject (user connected to your domain).
    Remember the user is the one which the code obtains when u login to your Domain based machine.
    Apart from this, Apache Http Server also provides you with a popup window asking for the user's credentials when u set the SSPIDomain in the httpd.conf file.
    httpd.conf
    ========
    <Location /Seet/servlet/ >
    SSPIAuth On
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "seet190 auth"
    AuthType SSPI
    SSPIAuth On
    SSPIAuthoritative On
    require valid-user
    SSPIDomain seet190
    </Location>
    seet190 is the domain name
    Actually so far in the Security Forum, u might refer to some of the replies posted for more help but actual LDAP authentication can be done by passing the user's info too.
    HTH,
    Seetesh

  • How can I implement recipe control concept in SAPME?

    Dears,
    How can I implement recipe control concept in SAPME?
    For example,
    We can config the standard temperature setting needs to be between 100~120 degree C for Operation OP1 and Material MA1
    So, before user start the SFC of MA1 at OP1, system can display the config values(100~120) for user reference, then, user need to input the real temperature when process the SFC, if it's out of spec, system can warning. System will collect the input data for analysis in future.
    Thank you.

    Thank you for your information.
    Since customer prefer to use a custom UI which can communicate with SAPME by web service.
    So I can not use SAPME default data collection or work instruction user interface.
    I'm considering by using data collection and work instruction config data to develop a web service in MII and poblish to custom UI in which it can display the spec data and reject user's input if out of spec.
    Please feel free to inform me if any other good idea, thanks!

Maybe you are looking for

  • Error while creation pdf file from XML

    Hi All, I am getting below error in java. Unexpected Error in method: public abstract com.elitecore.billing.utils.ResultObject com.elitecore.billing.ejb.bill.interfaces.IBillSearchSessionBeanLocal.getXsltContent(java.lang.String) java.lang.NoSuchFiel

  • Cannot use "convert to PDF" even though I'm subscribed

    I am subscribed to Adobe PDF pack (I am correctly signed in using the right profile, and the subscription is showing in my account in the Adobe app).  When I click on the convert to PDF button in order to convert a Word file to PDF a query box appear

  • Will other apps (like Skype) be able to use the effects?

    iChat and Photobooth use these funny effects. Are they somehow made with CoreAnimation, so that other apps can use the same effects?

  • Assembly BOM Option

    How do I need to configure an item in order for it to display an assembly BOM option? I take a current item which is configured as an assembly BOM and duplicate it. Give it a new code and name, then add it. When I go to Bill Of Materials and want to

  • BW, PIPE and POS DM

    What is the relation between BW, PIPE and POS DM? Is there any training about that?