Extra bytes in data transfer when using VISA and C++ instead of LABVIEW

Hello,
I've a problem when I try to download the capture buffer from a spectrum analyzer with C++Builder and VISA.
If I do that with LABVIEW (with VISA read and write) everything is fine. Instead, with C I get extra bytes in
the stream. In particular whenever there is a '0A' in the stream I get also a '0D' before it. I'm using a GPIB-USB-B card from National. I know I could easily get rid of those extra bytes in my code, but I'd like a cleaner solution.
Does anybody know the difference between the following code and LABVIEW VISA read and write routines?
Is there some attributes I have to set in C which is automatically set in LABVIEW?
Thanks a lot in advance!!
Simone
ViSession defaultRM, vi;
viOpenDefaultRM (&defaultRM);
viOpen (defaultRM, "GPIB0::10::INSTR", VI_NULL,VI_NULL, &vi);
ViStatus err = viSetAttribute(vi, VI_ATTR_IO_PROT, VI_NORMAL);
ViUInt32 retCount;
err = viWrite(vi, "CGET?0,0\n", strlen("CGET?0,0\n"), &retCount);
ViByte* buffer = new ViByte[100000];
err = viRead(vi, (ViByte*)buffer, 100000, &retCount);
FILE *fp;
fp = fopen("data", "w");
fwrite (buffer, retCount, sizeof(ViByte), fp);
fclose(fp);
viClose(defaultRM);
viClose(vi);
delete []buffer;

Simone,
this has to do with LabVIEW running on multiple platforms with different End-of-line signals.
With Windows this is usually 0x0d0a, which is the ASCII control code for . Other platforms use typically just one of those characters; I believe with MacOS there used to be just a 0x0a and with Unix this might have been 0x0d.
In order to avoid hazzles, the LabVIEW develloper decided to convert the platform-specific End-of-line signals into a LabVIEW-internal character (which is 0x0a) when reading strings and back when sending strings out of LabVIEW.
So, your device sends out 0xd0a and LabVIEW removes the 0x0d. Everything is OK.
Greetings from Germany!
Uwe

Similar Messages

  • I recently purchased a MacBook Pro and transferred data from my MacBook via Ethernet cable. I did not consolidate my accounts and kept using my MacBook. Can I update the data transfer now using Ethernet and can I consolidate my accounts?

    I recently purchased a MacBook Pro and transferred data from my MacBook using Migration Assistant via Ethernet cable.  I was confused about consolidating my accounts, so I continued to use my old MacBook.  Can I now update the data transfer using the same process and begin using my new MacBook Pro exclusively?  How do I consolidate my existing accounts?
    Thank you.

    Of course. It does everything it did before Yosemite. You just won't be able to send or receive SMS messages with it.

  • I have footage shot on a p2 camera, why won't all of the clips transfer when using Log and Transfer?

    Only about 60% of the clips transferred over or was shown in the Log and Transfer window.

    Offload the cards...back them up.  That is priority #1.  Do that first...then return the camera.  Then try mucking about with this.
    Back up the ENTIRE card structure.

  • Need to build communication redundancy using serial RS-232 for Data Transfer b/w Host and RT irrespective of TCP/IP Data Transfer

    Hi - I would like to build the logic in which it should accomodate the communication redundancy using serial RS-232 for Data Transfer b/w Host and RT irrespective of TCP/IP Data Transfer.
    I want to do data transfer b/w host and RT through RS232 VISA portal whenever TCP/IP ethernet cable has been unplugged from the controller continuosly , it should keep on checking for TCP/IP link re-establishing also , when ever the tcp/ip link established again that time the communication should be using in that link only. This is accomplished by deploying the RT vi as execuatbale file. I made some logic regards to the above said logic , bur it was not working as much I expected.
    I request you to go through the attached two VI's and let me know , what I did wrong in that,
    Please do the needful.
    Attachments:
    TCP_Serial_Host.vi ‏33 KB
    TCP_Serial_RT.vi ‏41 KB

    even i am new to this topic and i am trying to get familiar with these protocols
    refer to tcp server/client examples in labview examples

  • Can we set the dynamic data source when using getReportParameters() ?

    Hello!
    I have a report where one of its parameters refers to a list of values (LOVs). This list of values is an SQL Query type. When the data source used in the report is defined in the BI Publisher server, I'm able to get the report parameters using the getReportParameters() function in my application. However, if the data source is not defined the function throws an exception, which is understandable.
    I decided to dynamically set the data source so that even if the data source used by the report is not defined in the BI Publisher server, it still will be able to get the LOVs for the parameter. I tried setting the JDBCDataSource of the dynamicDataSource for the ReportRequest object that I passed to the getReportParameters() function. Please see the sample code below:
    reportRequest.dynamicDataSource = new BIP10.BIPDataSource();
    reportRequest.dynamicDataSource.JDBCDataSource = new BIP10.JDBCDataSource();
    setReportDataSource(reportRequest.dynamicDataSource.JDBCDataSource, connectstr, jdbc, dc); //function to set the values for JDBCDataSource object
    reportParams = webrs.getReportParameters(reportRequest, uid, pwd); //call the getReportParameters
    I was expecting this to work as this is what I did to dynamically set the data source before calling the runReport function. So, my question is -- can we set the dynamic data source when using getReportParameters() ? I tried this both in versions 10g and 11g. It does not seem to work on both versions.
    Regards,
    Stephanie

    report_id column of apex_application_page_ir_rpt can help us uniquely identify each saved report.
    We can assign this report_id value to a page item and this page item can be put in the Report ID Item text box of the Advanced section of the Report Attributes page of the IR.
    This should load the saved report identified by report_id and you can get rid of javascript
    Regards,
    Vishal
    http://obiee-oracledb.blogspot.com
    http://www.packtpub.com/oracle-apex-4-2-reporting/book
    Kindly mark the reply as helpful/correct if it solves your problem

  • How to totally turn off data traffic when using ma...

    Nokia N8-00:
    I only use the integrated gps and have turned off the assisted gps, net based gps and Wi-Fi/Network but when accessing maps it still generates data traffic.
    Normally this is´nt a problem but when traveling abroad data traffic costs a small fortune.
    In my old N95 when I downloaded offline maps and turned everything but integrated gps off there was no data traffic at all but even after the latest maps updates (i.e. yesterday) it appears that the maps still needs downloading when accessed...
    Any suggestions how to completely avoid data traffic when using maps?

    Set all destinations to always ask and select no whenever the phone gives you a request, set Maps to offline, and set location to just use intergrated GPS. By the way, just been to Portugal using Vodafone and data charges only about £5 for week, and they've just improved allowances, may be worth checking your service providers web site and see if it's necessary to bother about data roaming, they all tend to follow each other, and Data roaming charges in europe seem to be coming down !
    If I have helped at all, a click on the White Star is always appreciated :
    you can also help others by marking 'accept as solution' 

  • Why select data from Function directly (SE37) got data , but when use funct

    why select data from Function directly (SE37) got data , but when use function in program donot found data
    i use function
    CS_BOM_EXPL_MAT_V2
    when i run function directly at SE37 .
    i found data.
    but when i use same function in program .
    system not found.
    please see my attachment.
    help me please.
    [http://www.quickfilepost.com/download.do?get=c974356a498b3a4d369aa0c50622e50b]
    http://www.quickfilepost.com/download.do?get=c974356a498b3a4d369aa0c50622e50b

    I know why U get empty data.
    In Program U should follow the rules:
    U'd better data a variant typed the function parameters's type.
    for example:
    in your program the parameter: stlal  = '1'
    U'd better like follow:
    Data l_stlal type STKO-STLAL
    l_stlal = '01'.  *Attention: '1' <> '01'.
    stlal  = l_stlal.
    in this way U may have less mistake
    and the parameter MTNRV
    U should use material convernt : "CONVERSION_EXIT_MATN1_INPUT" to change material into internal types before U put into function's parameter.
    why se37 has no problem? because In se37, the data you filled was be processed before use

  • How to avoid data repetation when using select statements with innerjoin

    how to avoid data repetation when using select statements with innerjoin.
    thanks in advance,
    satheesh

    you can use a query like this...
      SELECT DISTINCT
             frg~prc_group1                  "Product Group 1
             frg~prc_group2                  "Product Group 2
             frg~prc_group3                  "Product Group 3
             frg~prc_group4                  "Product Group 4
             frg~prc_group5                  "Product Group 5
             prc~product_id                  "Product ID
             txt~short_text                  "Product Description
    UP TO 10 ROWS
    INTO TABLE l_i_data
    FROM
    Joining CRMM_PR_SALESG and
    COMM_PR_FRG_ROD
    crmm_pr_salesg AS frg
    INNER JOIN comm_pr_frg_rod AS prd
    ON frgfrg_guid = prdfragment_guid
    Joining COMM_PRODUCT and
    COMM_PR_FRG_ROD
    INNER JOIN comm_product AS prc
    ON prdproduct_guid = prcproduct_guid
    Joining COMM_PRSHTEXT and
    COMM_PR_FRG_ROD
    INNER JOIN comm_prshtext AS txt
    ON prdproduct_guid = txtproduct_guid
    WHERE frg~prc_group1 IN r_zprc_group1
       AND frg~prc_group2 IN r_zprc_group2
       AND frg~prc_group3 IN r_zprc_group3
       AND frg~prc_group4 IN r_zprc_group4
       AND frg~prc_group5 IN r_zprc_group5.
    reward it it helps
    Edited by: Apan Kumar Motilal on Jun 24, 2008 1:57 PM

  • [svn:fx-4.x] 15119: Menu. popUpMenu textAlign should be start rather than left so it works correctly when using FTEText and direction =rtl.

    Revision: 15119
    Revision: 15119
    Author:   [email protected]
    Date:     2010-03-29 13:49:52 -0700 (Mon, 29 Mar 2010)
    Log Message:
    Menu.popUpMenu textAlign should be start rather than left so it works correctly when using FTEText and direction=rtl.  Also made same change for AccordionHeader, CheckBox and RadioButton just to be safe.
    QE notes:
    Doc notes: None
    Bugs: SDK-26028
    Reviewed By: Kevin
    Tests run: checkintests
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-26028
    Modified Paths:
        flex/sdk/branches/4.x/frameworks/projects/framework/defaults.css

    Thank you so much wchp, this is brilliant. I have had this annoying problem for a long time. I eventually rang Mac support, they did not know how to fix the problem as you have suggested so they instigated many hardware replacements which eventually left my iMac severely crippled. They eventually replaced it with the latest model. But I spent two months working with a disabled computer which really interfere with my work.
    Your solution appears to have solved my problem, at least so far, but I am hopeful that it is a permanent fix. I hope that your suggestions are taken up by Apple support. This may solve many users problems and avoid Apple making expensive fixes that don't actually work.
    I thought that the new iMac would not have the 'Wake up from sleep by painting in the login window' problem but it did, this really annoyed me. Anyway now the problem appears to be solved, it's not I will repost and keep working on it. Thanks again.

  • Transfer posting using MM and SD

    Hi people,
    In the transfer postings using MM and SD, we have the following steps:
    Create the PO type UB
    Create the delivery document using VL10B
    Create MIGO and J1B1N using VL02N
    I would like to know about the information of tab "Value with taxes" of the item of J1B3N . Where it comes from?
    This document is created automatically, and the information of this fields doesn't appear in delivery document or in material document.
    I already changed some parameters in J1BTAX tcode, but it doesn't change in the J1B3N.
    Thanks, Camila Peralta

    If the supplying and receiving plants belong to different company codes, choose the document type 'NB' or a comparable document type of your own. A physical stock transfer is then carried out with delivery and billing document
    Here we make the STO with the transaction ME21N..at above you will two option to put..out of it one is document type..in other words you can say which type of document you wanna generate....
    After this, the STO process can be done in two steps...one is in ONE STEP PROCESS and other is TWO STEP PROCESS...
    In this along with the material document the accounting doc is also generated....In One step process, the stock in transit as well place in storage is done at the smae time...So its called one step process...
    Now if the delevery is done and if the delivery is the underdelivery then the system need to check the whether its allowed or not...if allowed then till what limit...so thisvalue is filled.
    It depends on your setting, whether you go for 2-step Stock Transport or 1-step.
    If It is 1-step then 1 material document and 1 accounting document.
    This material document will be of movement type 647 and stock will not come in transit, stock will directly get moved from Supplying Plant to Receiving Plant.
    And if it is 2-step then 2 material documents and 1 accounting document.
    1 material document for GI from Supplying Plant to Stock in Transit (Movement Type - 641), and another from stock in transit to receiving plant (Movement Type - 101).
    Accounting Doc in both cases will be;
    Stock A/c - Dr (Receiving Plant)
    Stock A/c - Cr (Supplying Plant)
    And it will update PO History in both the cases.
    You can config. this in SPRO > MM > Purchasing > Purchase Order > Setup Stock Transport order > Assign Document Type, One-Step Procedure, Underdelivery Tolerance > here activate "One-step" indicator if you want 1-step otherwise keep blank for 2-step.

  • How do I close a JInternalFrame when using subclasses and a separate cla...

    The heading should be: How do I close a JInternalFrame when using subclasses and a separate class for the actionListener?
    I have just created a JInternalFrame appclication and now I want to structure up my code. I have a Superclass that contains the usual settings for the two JInternalFrame:s, and the two subclasses with frame specific information. Both the JInternalFrames use the same OK button. I want to have the actionListener outside the classes to avoid repetition of code. But the dispose()-function does not work properly, it does not close the opened JInternalFrame. What�s wrong?
    class Superclass extends JFrame
         JButton b= new JButton("ok");    
         Superclass()
    class Subclass1 extends Superclass
         Subclass1 ()
              add(ok);
           ok.addActionListener(new Listener());
    class Subclass2 extends Superclass
         Subclass2 ()
              add(ok);
           ok.addActionListener(new Listener());
    class Listener extends Superclass implements ActionListener
         public void actionPerformed(ActionEvent e)
                   dispose();
    }How do I controll in the Listener class that the button in Subclass1 is beeing pressed?

    First of all I think I misunderstood your question. You said you had two internal frames, so I thought you wanted to close the internal frame.
    It now looks to me like you want to close the entire JFrame, which makes the code even a little easier. Something like:
    JComponent component = (JComponent)event.getSource();
    JFrame frame = (JFrame)SwingUtilities.windowForComponent( component );
    frame.dispose();
    Ok, I will make a try:
    public static Container getAncestorOfClass(Class c, Component comp)
    w.getAncestorOfClass(w, this); Fiirst you need to learn the basics of reading the API.
    "getAncestorOfClass()" is a static method. That means you don't use a variable to invoke the method. You use the class itself.
    "w" is a variable, which is a JFrame, but that is not what the first parameter should be. The first parameter is a "Class".
    "this" will refer to your Listener class, but you need the Component that generated the ActionEvent.
    When I thought you wanted to close an internal frame then the code would have been something like:
    JComponent component = (JComponent)event.getSource();
    Container container = SwingUtilities.getAncesterOfClass( JInternalFrame.class, component );
    JInternalFrame internalFrame = (JInternalFrame)container;
    internalFrame.invokeSomeMethodHere();If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)", that demonstrates the incorrect behaviour.
    http://homepage1.nifty.com/algafield/sscce.html

  • My photos are sharp but become soft when used in and IDVD slide show.

    My photos are sharp but become soft when used in and IDVD slide show. How can I prevent this from happining??

    Hi,
    I suggest that you try unchecking both of the crop options - landscape & portrait.
    To re-create your situation, I had to check the crop for landscape pictures option.
    I prefer to have control over any cropping so I tend to crop each image first before creating the slide show.
    Brian

  • Dreamweaver CC generates one of 3 error messages when using find and replace on Win 8.1 64 bit.

    Dreamweaver CC generates one of 3 error messages when using find and replace is used more than twice in succession. "While executing onLoad in bc_afterSave.htm, the following JavaScript error(s) occurred: At line 188 of file C:\Program Files (x86)\Adobe|Adobe DreamweaverCC|Configuration|Shared|BC\JS\bc_sites.js": out of memory"
    or
    While executing runCommand in File_Save.htm, a JavaScript erroroccurred.
    or
    While exciting getDynamicContent inAdressURL.htm, a Javascript erroroccirred.
    Any thoughts - I end up closing DWCC and reopening. Will work for two additional Find and Replace before the error messaged\s popup again.

    bkaufman43 wrote:
    Thanks Jon. I tried all of those solutions before posting. Same problem. It seems that the problem is tied to DWCC. Do not have the problem when using DW6 on Win8.1. When running DWCC on a Win7 pc, we get the same error message. When running DW6 on Win 7, f&c works fine. It seems to be a bug in DWCC. DWCC works flawlessly on our Macs.
    The same steps apply to DWCC, you just need to choose the CC folders rather than the DWCS4-6 versions that the page talks about. The layout of CC's folders hasn't changed from the older versions which is why, I think, Adobe hasn't updated the troubleshooting page as of yet.
    As Nancy mentions, a 38,500 page site is sort of ridiculously large for a static website, that could be part of the problem, but your response quoted above leads me to think you may have tried the troubleshooting steps in the wrong version of the program. Could you confirm that?

  • Explain How delivery date is calculated using backward and forward schedul

    How can anyone please explain how delivery date is calculated using forward and backward scheduling
    I want to have it broken down into the following steps
    for eg for delivery date calculation following dates are used
    Material Availabilty Date
    Material Staging Date
    Pick/pack time
    Transportation PLanning date
    Loading date
    Goods issue date
    Transit Date
    Delivery Date
    Can some one please give me an example and explain wht these dates are
    for eg customer needs delivery date on  11/20/2008
    how would the system cacluate whether it can meet the delivery date using backward scheduling
    and if it doesnt meet how does the system do the forward scheduling
    also i am not clear with the following dates
    material avaialibilty date
    material staging date
    transportation date
    can some one please explain me all this in detail
    Thanks

    Hi,
    Basically this is the CRSD(Customer requested ship date logic)logic in which system calculates the ship date depends upon the material availability. If material is available system calculates ship date on the basis of master data maintained in customisation.Master data is maintained in the  following link.
    If material is not available then system takes into consideration vendor delivery date & then calculate customer ship date.
    Please go through the link in SPRO
    LE-Shipping -Basic shipping functions-Scheduling -Delivery scheduling & Transportation scheduling-Maintain duration.
    In customisation following data is maintained
    Material Availabilty Date
    Material Staging Date
    Pick/pack time
    Transportation PLanning date
    Loading date
    Goods issue date
    Transit Date
    Delivery Date
    Hope you got the idea of CRSD calculation
    Regards,
    Prashant.

  • TS3742 I have an iMac 24" system. I just recently installed MAC OS X 10.7.4 (Lion) on my system. Since doing so, my system consistently hangs. Particularly when using iMovie and iPhoto.

    I have an iMac 24" system. I just recently installed MAC OS X 10.7.4 (Lion) on my system. Since doing so, my system consistently hangs. Particularly when using iMovie and iPhoto. I have to power off my system to get it running again. Any suggestions on what I can do  to address this situation.

    I would first reset the SMC:
    Shut down and unplug the Mac.
    Keep the Mac unplugged for at least fifteen seconds.
    Plug the Mac back in and do not turn it back on for at least five seconds.
    Press the power button to turn the Mac back on.
    Then I would reset the PRAM by rebooting the iMac while simultaneously holding the Command-Option-P-R keys until the machine restarts a second time.
    Let us know if these  procedures don't solve the problems.
    Hope this helps

Maybe you are looking for

  • Bug in Mac RDP App

    When asked about the untrusted app/certificate there is a checkbox to "always trust" and a dropdown to "always trust". Checking the box brigs up a system dialog asking for a password to confirm but the pointer turns into a spinning wheel and the syst

  • Airport Express not working properly since 4.2 update

    I use AE for Airtunes and it worked great until the 4.2 update several months ago. Since then it the light has remained solid amber unless I unplug it and then plug it back in. After doing this, it will remain green and connected while it is being us

  • Adobe Reader doesn't show correct version.

    Adobe Reader doesn't show correct version. How can i check if the current version (10.2.3) is installed?

  • Printing with doPrintAir() outputs a small box with weird lines

    Hi people. I'm following this: http://anirudhs.chaosnet.org/blog/2008.02.15.html And this: http://forums.adobe.com/thread/635799?tstart=0 To get my AIR+JS App printing, but even that simple sample outputs this on my printer: http://img27.imageshack.u

  • Authentication / authorization in jsf

    hi all! how can I perform a authentication/authorization system in jsf? Last time i've checked the user form and created a userBean in session scope,if the user is valid. how can I check if the user is logged and witch page he try to retrieve,for eve