OR-SCOPE exit on PFI0 or PCI1 5122

Hello

I'm a bit new to NOR-Scope.  I have a card 5122 and want to output a single pulse TTL on PFI0 or PFI1.  I don't want to not be triggered or something.  Basically, on my face, I have a button that says "Pulse" and when I press the appropriate IFP will display the single pulse.  I tried to use NIScope export Signal.vi but can't seem to make it work.

Thanks for any help!

Steve

Hi Steve,.

I want to assure you that I understand you. You are eager to get a signal on one of the PFI lines when you reach begins its acquisition. If that is correct, you can use the VI of Signal to export and choose to export the trigger to start. This should output a pulse when begins the acquisition. Let me know if it works for you.

Tags: NI Software

Similar Questions

  • How to use the coupling AC in NO-Scope 5122

    Hello

    I use no-Scope 5122. Here, I have a problem with the help of AC coupling. The error indicates that valid values are coupling-DC, HF reject.

    But the manual of 5122 said coupling AC can only be used if the input impedance is set to 1mW.

    Even after setting the input of 5122 to 1Mohm impedance, the same error is comin.

    Wait a sollution,

    Yogesh

    As far as I understand: YES!

  • While with PXI-5122 digitizer loop counter

    Hello world

    I am a beginner of products NOR. Currently I use the PXI-5122, 2014 Labview for the ultrasonic signals. I have a problem when you count the number of signals using an external trigger (by a function generator) source. When I trigger the digitizer under 50 Hz, the meter is working properly (a single trigger = a signal). With a frequency greater than 50 Hz of trigger, the meter is malfunctioning. For example, with the shutter to 50 Hz and 500 number of signals, the counter takes 10s to get data. But, with the trigger of 100 Hz and 500 number of signals, the acquisition time was always around 10 s.
    You can see the code in the file attachment.

    Please let me know if you have any suggestions or recommendations for my situation, I would appriciate that.

    Thanks in advance!
    Best regards
    You

    WorldALoneMe,

    Looking at your code, you're software re - trigger your device.  With your Setup, you configure the digitizer to hold a single record acquisition in your "A - Scan.vi".  This VI opens the resource OR-SCOPE, configure, captures, returns the data, then closes the resource OR-SCOPE.  It then does this for each unique A-Scan that you do and would be the reason that b Scan.vi takes so long.  It appears then that fewer than 50 Hz, this reset any software and reconfiguration and the acquisition can occur without missing a trigger, but more than that, your triggers occur faster it takes to do these things.

    What you need to do set up the digitizer to a multi-record acquisition.  This is done using the 'niSCope configure horizontal timing.vi' and wiring in a number higher than '1' in the entry "number of records".  "You can find an example of how to perform a multi-record acquisition if you open the Finder of example OR > material input and output > Modular Instruments > NOR-SCOPE > Getting Started > niScope EX Multi Record.vi.

    In this example, the digitizer is only once configured, and it returns all the documents requested at the same time.  For your application, each record would be a simple Scan of A, and then if you configure 500 files, your B-Scan would be 500 wide.  This time allows the material to rearm between triggers that is much faster to do it in software.

    For a verification of more complex example out (in the finder of the example) "niScope EX Multi record go get more available Memory.vi"

    Kind regards

    Nathan P.

  • OR-scope disconnect routing BUG?

    I use a synchronized with a 6652 and a 5124 5922.

    runs the task I want to tried get relaxation from start to PFI0 or PFI1, routing, however NO PFI0 or PFI1 does not seem to disconnect the routing.

    I have attached a simple vi for test. An additional cable to monitor the PFI mini DIN output to a scope is necessary

    1. Choose the 5922, run the vi.

    2. Read success (some samples are taken)

    3. Press the PFI0 button (START TRIGGER is routed to PFI0)

    4. to read (see the trigger on the PFI0 pulse)

    5. disable the PFI0 button (none is routed to PFI0)

    6. Hit read (uups, always trigger pulse here)

    Is this a BUG or how to disconnect the starting of the PFI trigger signal without losing my sync?

    Henrik,

    I don't see the problem, your code does not work as you described, but how you try to unplugged the lines wrong REIT.  In the niScope export Signal documentation, it says "unprogram a specific line on a device, call this VI with the signal is no longer you want to export, and then set it to any Terminal output

    In your code, you write you write Trigger start to PFI0, which allows the export of the trigger PFI0 to start.  To cancel it, you must write Start Trigger None (no PFI0).  You write 'none' to the wrong entrance of the vi.

    Attached is a copy of your VI it properly deactivated the IFP routing.

    I hope this helps!

    Nathan

  • Error-201427 on PXI-5122 since NI MAX system

    I need to check that the PXI-5122 is supported by NO-Scope 4.0.0 under WINdows 7 64-bit. If so, I guess I can get a damaged card. The system was running under the old computer / code / drivers last month.

    Scenario is this: I'm upgrading of already running code to a new computer and 32-bit 64-bit CVI CVI. After plowing, of code tweaks, PXI, 5122 digitizer shows through a new error in the code. I go back NI Max and I get this related error when I try to post.

    "The driver could not communicate with PXISlot2, generates the following message:

    Error-201427 to the autotest

    Possible reasons:

    The specified device is not supported in the API OR-DAQmx.

    Specified device PXISlot2.

    Seeing this, I have tried NOR updated, and nothing has been marked. I shut down the system and reseat the card. Then I checked the version of NOR-Scope (was 3.9.4) OR MAX I downloaded manually OR-Scope 4.0.0. Same mistake.

    The 5122 is in slot 2 and NI MAX identifies the card as "2: NOR-PXI-5122"PXISlot2"

    More information on the current system

    Dell Precision T3600

    Win7 64 bit Enterprise SP1

    Spincore NMR TIming Pulsebalster PCI card

    PCIe copper x 4 remote link to the chassis OR 1062 q

    In the NI 1062 q

    Slot 1: NI SMU-8370 remote control

    Slot 2: OR PXI-5122

    SLOT3: NOR SMU-5442

    Slot 4: reports of empty in fact NEITHER SMU-8262 linked to a NI PCIe-8263 (shows in Windows, normal visibility NI Max is unknown)

    Slot 5: OR PXI-6733

    Slot 6: OR PXI-6733

    Slot 7: vacuum

    Slot8: OR PXI-5421

    Measurement and Automation Explorer System Information (current after upgrade NI-Scope) is attached

    Before I track down a loan 5122, I wanted to see if there are known incompatibilities that come to mind.

    Thanks in advance.

    There is a material-200313 error on the map (and the first replacement) as revealed by an earlier version of NIMAX (another computer and PXI chassis). The information contained in the attached document can help improve diagnosis in the future (rather than the more highest credits of the error).

    With a third scanner system is running.

  • PXI-5122 and PXI-6259 read 2 channels simultaneously

    There is a single PXI-5122 digitizer card and a PXI-6259 DAQ card in our PXI system, we use Labview and TestStand (model Batch) to test the multiplication Board simultaneously, sometimes up to 8 boards are tested. We have some problems, such as the results of the tests is not reliable and sometimes blocking of Labview. Everything works fine when test single board. Thus, we feel that multiply causing this problem of acquisition of string data. It's great, if someone has the same problem and we can share the knowledge. My question is as follows:

    1. If two channels have been configured, read the two channel simultaneous cause blocking of the system or data damaged?

    "lu niScope WDT.vi" is reentrant, we can use two Subvi to call the "niScope Read WDT.vi' access the two channels simultaneously.

    2. If we set up a channel in another channel is reading the data, this situation will cause the search system or corrupt data.

    Concerning

    Samuel

    Hi Samuel,.

    You shouldn't have any difficulty to read several channels on your 5122 or between your 5122 and your 6259. You receive an error message when your test is blocked? What happens when your test is not reliable? Are you incorrect data and if so what is the data vs expected data acquired? You should be able to set both your channels in a single task, which would be using a read niScope WDT.vi to be used by the device. You are working from example or have you developed your own code? What version of the driver NOR Scope and NI-DAQmx driver do you use? You can find the driver version number in the measurement and Automation Explorer under the software section.

    What kind of test are you running? Your PXI chassis is controlled by a computer or by an on-board controller? Evolution of the rate of acquisition has an effect on your program?

  • error "Ibsta" no was not declared in this scope

    I have a "error: 'Ibsta' was not declared in this scope."

    I try to program with C++ and GPIB test equipments, but so far, I have this problem.

    I'm sorry, but my knowledge of C++ is very limited because I took a module on it for about 4 months in College and now I have to rectify emergency for my project. Any help would be much apprciated, I tried searching the forums, but I still have to find an answer. I think it has something to do with my linker. BTW, I use Code blocks to compile program, so it may be different from other IDEs posted here such as Microsoft Visual C++, Borland, Dev C++.

    The program that I write to you is as follows:

    #include
    #include "ni488.h".
    #include
    #include
    #include "Decl. - 32.h"
    #include

    using namespace std;

    void GpibError (const char * msg); / * Function to Error statement * /.

    Device int = 0; / * Peripheral device descriptor * /.
    int BoardIndex = 0; / * Interface index (GPIB0 = 0, GPIB1 = 1, etc..) * /.

    int main() {}
    int PrimaryAddress = 28; / * Main unit address * /.
    int SecondaryAddress = 0; / * Secondary unit address * /.
    char Buffer [101]; / * Read buffer * /.

    /*****************************************************************************
    * Boot - made only once at the beginning of your application.
    *****************************************************************************/

    Device = ibdev (/ * create a device descriptor pointer * /)
    BoardIndex, / * Board Index (GPIB0 = 0, GPIB1 = 1,...) * /.
    PrimaryAddress, / * address of the primary device * /.
    SecondaryAddress, / * peripheral secondary address * /.
    T10s, / * delay (T10s = 10 seconds) option * /.
    1, / * line EOI assert at the end of writing * /.
    (0); / * Mode of termination EOS * /.
    If (Ibsta() & ERR) {/ * find GPIB error * /}
    GpibError ("ibdev Error");
    }

    ibclr (Device); / * System * /.
    If {(Ibsta() & ERR)
    GpibError ("ibclr Error");
    }

    /*****************************************************************************
    * Body - writing the majority of your GPIB application code here.
    *****************************************************************************/

    ibwrt (device, "* IDN?", 5 "); / * Send the command ID of the query * /.
    If {(Ibsta() & ERR)
    GpibError ("ibwrt Error");
    }

    Bird (device, buffer, 100); / * Read up to 100 bytes of the device * /.
    If {(Ibsta() & ERR)
    GpibError ("Bird error");
    }

    Buffer [Ibcnt ()] = '\0 '; / * Null terminate the string ASCII * /.

    printf ("%s\n", buffer); / * Print the device identification * /.

    /*****************************************************************************
    * UN-initialize - done only once at the end of your application.
    *****************************************************************************/

    ibonl (device, 0); / * Turn off the line * /.
    If {(Ibsta() & ERR)
    GpibError ("ibonl Error");
    }

    }

    /*****************************************************************************
    * Function GPIBERROR
    * This function will warn you that a function of NOR-488 failed by
    * a print error message. The State IBSTA variable will also be
    * printed in hexadecimal with the senses mnemonic of the forest
    * position. The State IBERR variable will be printed in decimal form
    * with the mnemonic significance of the decimal value. The status
    * Variable IBCNT will be printed in decimal form.
    *
    * The NOR-488 IBONL function is called to turn off the equipment and
    * software.
    *
    OUTPUT Comptrollership will end this program.
    *****************************************************************************/
    void GpibError (const char * msg) {}

    printf ("%s\n", msg);

    printf ("Ibsta () = 0 x %x<",>
    If (Ibsta() & ERR) printf ("ERR");
    If (Ibsta() & TIMO) printf ("TIMO");
    If (Ibsta() & END) printf ("END");
    If (Ibsta() & SRQI) printf ("SRQI");
    If (Ibsta() & RQS) printf ("QR");
    If (Ibsta() & CMPL) printf ("CMPL");
    If (Ibsta() & LOK) printf ("LOK");
    If (Ibsta() & REM) printf ("REM");
    If (Ibsta() & CIC) printf ("CIC");
    If (Ibsta() & ATN) printf ("ATN");
    If (Ibsta() & TAC) printf ("TAC");
    If (Ibsta() & MFP) printf ("LAKES");
    If (Ibsta() & CDI) printf ("CDI");
    If (Ibsta() & DCAS) printf ("DCAS");
    printf ("" > \n ");

    printf ("Iberr() = %d", Iberr() ");
    If (Iberr() == EDVR) printf ("EDVR \n");
    If (Iberr() == ECIC) printf ("in ECIC \n");
    If (Iberr() == ENOL) printf ("ENOL \n");
    If (Iberr() == EADR) printf ("EADR

    \n");

    If (Iberr() == HELLO) printf ("the GRAE \n");
    If (Iberr() == ESAC) printf ("ALD \n");
    If (Iberr() == EABO) printf ("EABO \n");
    If (Iberr() == ENEB) printf ("ENEB \n");
    If (Iberr() == PAES) printf ("PAES \n");
    If (Iberr() == ECAP) printf ("ECAP \n");
    If (Iberr() == EFSO) printf ("EFSO \n");
    If (Iberr() == USBE) printf ("USBE \n");
    If (Iberr() == ESTB) printf ("ESTB \n");
    If (Iberr() == ESRQ) printf ("ESRQ \n");
    If (Iberr() == XTAB) printf ("Established\n");
    If (Iberr() == ELCK) printf ("ELCK \n");
    If (Iberr() == MART) printf ("MART \n");
    If (Iberr() == EHDL) printf ("EHDL \n");
    If (Iberr() == EWIP) printf ("EWIP \n");
    If (Iberr() == ERST) printf ("ERST \n");
    If (Iberr() == EPWR) printf ("EPWR \n");

    printf ("Ibcnt () = %u\n", Ibcnt() ");
    printf ("\n");

    / * Call the ibonl to get the device and interface offline * /.
    ibonl (device, 0);

    "exit" (1);
    }

    The program I had is a sample I found the Instrument National software called GPIB Explorer.


  • MAX can't see my SMU-5122

    Hello

    I am currently in a period of training, and I try to install a banch instrumentation for my tutor.

    So I have a SMU-1075 chassis, which is connected to my computer by an SMU-8370.

    There are 3 modules:

    PXI-4071

    PXI-5422

    SMU-5122

    For the first two I have no problem to see at MAX. But the last of them does not appear in MAX?

    I installed LabView 2010, also NEITHER Scope and provides many other software with my products.

    Can someone help me? =)

    Hi Thibloiz,

    What version of NOR-Scope? You should be able to get the version # in the list of software in MAX.

    Have you tried the 5122 in other locations of your chassis? It shows in the Windows Device Manager?

  • OR-SCOPE-223409 error

    I got an error in the driver OR-SCOPE (version 4.1.3), using the NOR-5122 digitizer. The error is died in the niScope_SendSoftwareTriggerEdge function. The relevant sequence of commands that I send is:

    Secret = niScope_Abort (SessionID);
    Secret = niScope_ConfigureHorizontalTiming (SessionID, 380E6, 256, 0.0, 1, VI_FALSE);
    Secret = niScope_ConfigureTriggerEdge (SessionID, "0", 0,0, NISCOPE_VAL_POSITIVE, NISCOPE_VAL_DC, 0.0, 0.0);
    Secret = niScope_ConfigureChanCharacteristics (SessionID, '0', NISCOPE_VAL_50_OHMS, 0,0);
    Secret = niScope_ConfigureVertical (SessionID, "0", 0.2, 0.0, NISCOPE_VAL_DC, 1.0, VI_TRUE);
    Secret = niScope_InitiateAcquisition (SessionID);
    Secret = niScope_SendSoftwareTriggerEdge (SessionID, NISCOPE_VAL_SOFTWARE_TRIGGER_REFERENCE); Secret = 223409

    The return of niScope_errorHandler is:

    Error FFFC974F.

    Possible reasons:
    Internal software error has occurred in the extended software. Please contact the support of National Instruments.

    Name of the component: nihsdrk
    File name: \Measurements\highSpeedDigitizers\hsd\driver\trunk\4.1.1\source\kernelPrimitive\tMacroSupervisor.cpp
    Line number: 716

    Source:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:
    unknown (0)?:

    State code:-223409

    The error will not occur if I call niScope_close and niScope_init after every acquisition, but I guess I should not have done that.

    Hi rings,

    It is a known issue, you're right that you shouldn't call niScope_close and niScope_init each time, but for now, this is the best solution.

  • material missing triggers hdio? (PFI0)

    I use (or rather try, for now) to use the HSDIO card for acquisition as follows:

    Script generation according to schema: (l1, wrtcfg1, wrtlat are the wave forms long 1000clock)

    script myscript

    generate a l1

    Repeat 10

    generate a marker0 wrtlat (0)

    generate a marker0 wrtcfg1 (0)

    end repeat

    end of script

    Marker0 is exported (correctly) to PFI0. Same line is set up to run at acquiring data (records multiple, both start and advance Trig point to the same PFI0 signal). For test purposes I do this with SMA2164, where Channel 6 (wvfm sent to DUT) is connected directly to the ch4 (received wvfm of HAD) to get rid of the possible influence of the HAD. What worries me is that I seem to take _half_ of the signals I generate, rather than all. The attached vi has two loops of independent test, the generation timed a (every second, making the above script), which means generation 2xrepetitions (20 in the example above) trigger pulses on PFI0 (scope proves this hypothesis being right). However, the second for loop - part acquisition (iteration of 20 records each loop CQI, timeout 10 s), which should in principle work once by each iteration of loop generation runs only every second.

    I would be grateful for my mistakes to score.

    Michal

    PS: Checked behavior on two different configurations, one with PCI-6562, second with PXI-6562. Both Miss the triggers of the PFI line (no difference which) in the present scenario.

    Hello

    I just read your message. In your case I would suggest using the Insider/Fetch combination rather than read (Fetch is better when you need to acquire data and expect that the triggers). It is also important to remember that you must initialize first acquire the task and then generate task (in your case first trigger is generated after 10 ms, which may not be sufficient for the task of acquiring start).

    Please find sample application that:
    1 initializes the acquisition of 1 s after tripping to Marker 0 (line 0 PXI)
    2 generates the trigger (line 0 PXI) and 1 s data
    3 generates 1 s of zeros
    4 generates the trigger (line 0 PXI) and 1 s data

    Task of acquisition has to read data only from points 2. and 4.

    Hope this helps,
    Best regards
    Michal

  • PCI-6221 PFI0 start trigger is stray signals reading

    We have a card PCI-6221 attached to a SCB-68 in a control console, we've made dozens of times. However, this time, we will have problems with the beginning of PFI0 relaxation. Operation of the actuators 24 v remote (cable to DAQ card but operated through manual switches) triggers the beginning. We tried a shielded cable and everything is grounded. There is no parasitic voltage coming into the SCB-68 box. We sent also all the other analog I/o box. It's just the son of trigger start going. What is unusual, is that if we give a thread to the PFI0 (Terminal 11) who does not finish anywhere, we just hold in the air, do not cross any other thread, running our actuator valves still initiates the trigger. If we remove the wire, it does not raise. It's almost as if she receives wireless signals. But how wireless receives + 5V to trigger I don't understand. We also tried to use a spare PCI-6221, same known issue work. When you view the PFI0 in MAX, flipping the switch actuator will cause the counter generate 400 + charges. A normal release with our power switch usually generate 10-20-count indictment. We are really puzzled. Thanks for any help!

    Don't have not an answer to the first question, will have to research.

    THA Cabinet is wired the same, the only difference is that we added a transformer so that the system can run on the seas, but has not actually been hooked again, sitting in the Cabinet.

    Yes, we used a cable leading to one end. We tried the ground at both ends, the same results. I also waved to the cable in the air and a people in the head with it, it made me feel better.

    Don't think on the unused entries in the Earth. Personally, I think that the PFI0 is to be triggered with less than the + 5V, the scope is the very low voltage reading.

    But I found a solution. I mentioned in the original post that trigger actuator, just once, causing 400 + edge detections/counts when viewing in MAX. It is a large number of charges in such a short time. So I programmed in a digital filter using a min pulse width. ".". 00256. Eliminating the 400 + short bursts of any signal. I used the example of filtering VI in this knowledge base article:

    http://digital.NI.com/public.nsf/3efedde4322fef19862567740067f3cc/9ece7dbe7df338bd86256f8600734a41?O...

    For those who have similar problems, there is no physical change, just incorperate of wiring of the filter.

  • NI 5122 range Variable sampling rate

    Hello

    I use a digitizer card high-speed NI 5122 to acquire data and synchronize the sampling frequency of the frequency of the data card.  For example, my first set of data will have a frequency of 13.6 MHz so I would taste 13.6 MHz.  When I connect a signal 13.6 MHz to the CLK IN on the front panel of the card and write Labview code to taste at this rate (for the sample clock or reference clock), I get error message.  Anyone know if its possible to have a sampling rate variable really for this card?

    Thank you

    Steve

    Hi Steve,.

    I understand that you are using a digitizer high-speed 5122 and try to use an external sample clock. What kind of error messages received when you doing? In addition, how you set up the device to use this external clock?

    "" "" I would also like to point out that there is a very useful example program in the example Finder LabVIEW ('Help' to find examples) found in e/s material "Modular Instruments ' OR-SCOPE" features ""niScope Clocking.vi external EX' that allows the user to make a simple acquisition using an external clock source. To specify the source of external clock, rate and divisor, a knot of niScope property is used. You should be able to try this example and use the same method in your program. Hope this helps,

  • LabVIEW memory full error in 5122 when I acquire samples of 50 M...

    I use 8 Labview for acquiring data card PXI-5122 (512 MB RAM). Samples using 100Ms rate... Now, I need to acquire samples of 50 M. It takes 400MB size of the file when recording... When I begin to acquire its gives Me the error "Memory full" and sites...

    When I acquire two channel it acquires only the 20 M maximum DBL format data. using a channel it acquires 50 M maximum format DBL... I need more sample... How can I do?

    When I did it with PLEDGE card, I had only 8 MB of RAM. I have been acquiring 42Ms rate... and he took too many samples... I don't know why Labview or PXI can not handle...
    Pledge card was acquire only 16-bit format. and that was enough... all in Labview acquires DBL it requires 64bir for a sample format... and if I put it in the below format (I32 or I16) it gives data... which is not true values

    Please help me...!

    CYBORG,

    There is an example that does just what you are looking for in the example finder LabVIEW ('Help' to find examples... ("" "" "Material input and output" Modular Instruments ' OR-SCOPE ' general ' niScope EX binary Acquisition). This example shows how to use the offset and gain to calculate the voltage at the scale.

  • Error "batteryInfo" has not declared in this scope

    Hi, I have this error in my project, I understand the example of the battery of the sample, but I get the error of generation.

    'MarcossitMobile10::MarcossitMobile10(bb::cascades::Application*)':
    ../src/MarcossitMobile10.cpp:17:42: error: 'batteryInfo' was not declared in this scope
    cc: C:/bbndk/host_10_0_9_404/win32/x86/usr/lib/gcc/arm-unknown-nto-qnx8.0.0eabi/4.6.3/cc1plus caught signal 1
    make[2]: *** [o.le-v7-g/.obj/MarcossitMobile10.o] Error 1
    make[2]: Leaving directory `C:/Users/marcossit/ndk-10.0.9-workspace/MarcossitMobile10/arm'
    make[1]: *** [debug] Error 2
    make[1]: Leaving directory `C:/Users/marcossit/ndk-10.0.9-workspace/MarcossitMobile10/arm'
    make: *** [Device-Debug] Error 2
    
    **** Build Finished ****
    

    I don't understand this part I declare scope

    This is the main.cpp Batterysample

    /* Copyright (c) 2012 Research In Motion Limited.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    
    #include 
    #include 
    #include 
    #include 
    
    #include 
    #include 
    
    using namespace bb::cascades;
    using namespace bb::device;
    
    /**
     * This sample application shows some basic
     * usage of the BatteryInfo API, such as charging level and charging state.
     */
    Q_DECL_EXPORT int main(int argc, char **argv)
    {
        qmlRegisterUncreatableType("bb.device", 1, 0, "BatteryChargingState", "");
    
        Application app(argc, argv);
    
        QTranslator translator;
        const QString locale_string = QLocale().name();
        const QString filename = QString("batterysample_%1").arg(locale_string);
        if (translator.load(filename, "app/native/qm")) {
            app.installTranslator(&translator);
        }
    
    //! [0]
        // Create the battery info object
        BatteryInfo batteryInfo;
    
        // Load the UI description from main.qml
        QmlDocument *qml = QmlDocument::create("asset:///main.qml");
    
        // Make the BatteryInfo object available to the UI as context property
        qml->setContextProperty("_battery", &batteryInfo);
    //! [0]
    
        // Create the application scene
        AbstractPane *appPage = qml->createRootObject();
        Application::instance()->setScene(appPage);
    
        return Application::exec();
    }
    

    It's my main.cpp

    /*
    * Copyright (c) 2012 Jason I. Carter
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    #include "Flashlight.hpp"
    #include 
    #include 
    #include 
    #include 
    
    #include 
    #include 
    #include 
    #include "MobileMarcossit.hpp"
    #include "RegistrationHandler.hpp"
    #include "InviteToDownload.hpp"
    #include 
    
    using namespace bb::cascades;
    using namespace bb::cascades::advertisement;
    
    Q_DECL_EXPORT int main(int argc, char **argv)
    {
        // this is where the server is started etc
        Application app(argc, argv);
    
        // localization support
        QTranslator translator;
        QString locale_string = QLocale().name();
        QString filename = QString( "MobileMarcossit_%1" ).arg( locale_string );
        if (translator.load(filename, "app/native/qm")) {
            app.installTranslator( &translator );
        }
        BatteryInfo batteryInfo;
        const char *uri = "bb.cascades.advertisement";
           qmlRegisterType(uri, 1, 0, "Banner");
           qmlRegisterUncreatableType("bb.device", 1, 0, "BatteryChargingState", "");
           qmlRegisterType("Flashlight", 1, 0, "Flashlight");
    
        // Every application is required to have its own unique UUID. You should
        // keep using the same UUID when you release a new version of your application.
        //TODO:  YOU MUST CHANGE THIS UUID!
        // You can generate one here: http://www.guidgenerator.com/
        const QUuid uuid(QLatin1String("c4e27f7c-f9d2-40dc-8630-1d037a0a1309"));
    
        //Setup BBM registration handler
        RegistrationHandler *registrationHandler = new RegistrationHandler(uuid, &app);
    
        //AppName.cpp file which contains your main.qml file
        MobileMarcossit *mobileMarcossit = new MobileMarcossit(registrationHandler->context(), &app);
    
        // Whenever the registration has finished successfully, we continue to the main UI
        // Added finishRegistration() to registrationFinished()
        // This is to emit signal and by pass use of continue button as shown in sample
        QObject::connect(registrationHandler, SIGNAL(registered()), mobileMarcossit, SLOT(show()));
    
        // we complete the transaction started in the app constructor and start the client event loop here
        return Application::exec();
        // when loop is exited the Application deletes the scene which deletes all its children (per qt rules for children)
    }
    

    It's my MarcossitMobile10.cpp

    // Default empty project template
    #include "MarcossitMobile10.hpp"
    
    #include 
    #include 
    #include 
    #include 
    using namespace bb::cascades;
    
    MarcossitMobile10::MarcossitMobile10(bb::cascades::Application *app)
    : QObject(app)
    {
    
             // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        qml->setContextProperty("_battery", &batteryInfo);
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
    
        // set created root object as a scene
        app->setScene(root);
    }
    

    and get the error in this line that I declare.

     qml->setContextProperty("_battery", &batteryInfo);
    

    Help...

    Organizing in this way PPH, but already now, run nothing comes in my dev alpha application

    MarcossitMobile10.hpp

    // Default empty project template
    #ifndef MarcossitMobile10_HPP_
    #define MarcossitMobile10_HPP_
    
    #include 
    
    #include 
    namespace bb { namespace cascades { class Application; }}
    
    /*!
     * @brief Application pane object
     *
     *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
     */
    class MarcossitMobile10 : public QObject
    {
        Q_OBJECT
    public:
        bb::device::BatteryInfo* batteryInfo;
        MarcossitMobile10(bb::cascades::Application *app);
        virtual ~MarcossitMobile10() {}
    };
    
    #endif /* MarcossitMobile10_HPP_ */
    

    the qml constructor is bateria.qml

    /* Copyright (c) 2012 Research In Motion Limited.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    
    import bb.cascades 1.0
    import bb.device 1.0
    
    // Page laying out the visual components
    Page {
        Container {
            layout: DockLayout {}
    
            ImageView {
                horizontalAlignment: HorizontalAlignment.Fill
                verticalAlignment: VerticalAlignment.Fill
    
                imageSource: "asset:///images/bateria/background.png"
            }
    
            Battery {
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Center
            }
    
            Container {
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Bottom
    
                bottomPadding: 50
    
                //! [0]
                Label {
                    id: stateLabel
    
                    horizontalAlignment: HorizontalAlignment.Center
    
                    text: {
                        switch (_battery.chargingState) {
                            case BatteryChargingState.Unknown:
                                return qsTr ("Unknown");
                                break;
                            case BatteryChargingState.NotCharging:
                                return qsTr ("Not Charging");
                                break;
                            case BatteryChargingState.Charging:
                                return qsTr ("Charging");
                                break;
                            case BatteryChargingState.Discharging:
                                return qsTr ("Discharging");
                                break;
                            case BatteryChargingState.Full:
                                return qsTr ("Full");
                                break;
                        }
                    }
                    textStyle {
                        color: Color.White
                        fontSize: FontSize.XLarge
                    }
                }
                //! [0]
    
                Label {
                    id: descriptionLabel
    
                    horizontalAlignment: HorizontalAlignment.Center
                    bottomMargin: 100
    
                    text: {
                        switch (_battery.chargingState) {
                            case BatteryChargingState.Unknown:
                                return qsTr ("Something is up with the battery");
                                break;
                            case BatteryChargingState.NotCharging:
                                return qsTr ("Plugged in, just no charge");
                                break;
                            case BatteryChargingState.Charging:
                                return qsTr ("Plugged in");
                                break;
                            case BatteryChargingState.Discharging:
                                return qsTr ("Unplugged and discharging");
                                break;
                            case BatteryChargingState.Full:
                                return qsTr ("Plugged in, full");
                                break;
                        }
                    }
                    textStyle {
                        color: Color.Gray
                        fontSize: FontSize.Large
                    }
                }
            }
        }
    }
    

    and the qml plugin is Battery.qml

    /* Copyright (c) 2012 Research In Motion Limited.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    
    import bb.cascades 1.0
    import bb.device 1.0
    
    Container {
        preferredWidth: 498
        preferredHeight: 318
    
        layout: DockLayout {}
    
        //! [0]
        ImageView {
            id: batteryOutline
    
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
    
            imageSource: _battery.chargingState == BatteryChargingState.Unknown ? "asset:///images/bateria/battery_plugged_error.png" :
                         _battery.chargingState == BatteryChargingState.NotCharging ? "asset:///images/bateria/battery_plugged_bad.png" :
                         _battery.chargingState == BatteryChargingState.Charging ? "asset:///images/bateria/battery_plugged.png" :
                         _battery.chargingState == BatteryChargingState.Discharging ? "asset:///images/bateria/battery.png" :
                         _battery.chargingState == BatteryChargingState.Full ? "asset:///images/bateria/battery_plugged.png" : ""
        }
        //! [0]
    
        //! [1]
        ImageView {
            id: loadingLevel
    
            horizontalAlignment: HorizontalAlignment.Left
            verticalAlignment: VerticalAlignment.Center
    
            translationX: 75
            preferredWidth: _battery.level * 350.0 / 100.0
    
            imageSource: _battery.level <= 10 ? "asset:///images/bateria/fill_red.png" :
                         _battery.level <= 20 ? "asset:///images/bateria/fill_yellow.png" :
                         _battery.level < 100 ? "asset:///images/bateria/fill_grey.png" : "asset:///images/bateria/fill_green.png"
        }
        //! [1]
    
        ImageView {
            id: stateIndicator
    
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
    
            imageSource: _battery.chargingState == BatteryChargingState.Unknown ? "asset:///images/bateria/exclamation.png" :
                         _battery.chargingState == BatteryChargingState.NotCharging ? "asset:///images/bateria/exlamation.png" :
                         _battery.chargingState == BatteryChargingState.Charging ? "asset:///images/bateria/flash.png" :
                         _battery.chargingState == BatteryChargingState.Discharging ? "" :
                         _battery.chargingState == BatteryChargingState.Full ? "" : ""
        }
    }
    

    It will be something else?

    qml->setContextProperty("_battery", &batteryInfo);
    

    for example

    qml->setContextProperty("_bateria", &batteryInfo);
    
    or
    
    qml->setContextProperty("Battery", &batteryInfo);
    
  • SignTool.exe check /pa returns the exit code 1 from the code, but works fine when running from the command prompt.

    Hello

    I use SignTool.exe since a new Process() to check an Assembly codesigned and it returns the exit code 1 so that it returns the exit code 0 while I run the same Visual Studio command prompt. Please let me know your thoughts...
    Here is an excerpt of my ultimate VS2012 code on PC Win7.
    p = new Process();
    p.StartInfo.FileName = "C:\\Program Files (x 86) \\Microsoft SDKs\\Windows\\v7.0A\\Bin\\SignTool.exe";
    String args = @ "check."
    p.StartInfo.Arguments = args + "" + '/pa' + ' / v '+ name; "" "
    p = Process.Start (p.StartInfo.FileName, p.StartInfo.Arguments);
    p.Start ();
    p.WaitForExit ();
    pexitcode = p.ExitCode;
    name = 'C:\\Users\\v-maparn\\Documents\\Visual Studio 2012\\Projects\\CodesignVerification\\CodesignVerification\\bin\\Release\\Microsoft.IT.Core.dll'
    Thank you
    Mani

    Salimakadari

    This issue is beyond the scope of this forum that you might better ask on Technet or MSDN (Microsoft developer network)

    http://social.technet.Microsoft.com/forums/en-us/home

    https://social.msdn.Microsoft.com/forums/en-us/home

Maybe you are looking for