Using the SVDEx function in LabWindows​CVI

Hello,
I am writing an application in LabWindows CVI to display and analize data that we obtain in an optical experiment.  The data is a matrix where the subsequent rows represent spectra collected a different times. There are about 200 columns and 100 rows in each matrix. I want to use singular value decomposition using the  SVDEx function. I get an error every time i try to execute the code in debugguing mode:
FATAL RUN-TIME ERROR:    The program has caused a 'General Protection' fault at 0x0342BC16.
I believe that I am passing the incorrect arrays to SVDEx. I  was wondering if there is any example code available, so I can learn how tro do do this.
Here is a fragment of the code where I call the function SVDEx:
//declare the arrays to hold S U V
double *U,*S,*V;
int isizeS=Y_DATA_POINTS;
int i;
int AnalisisError=0;
if (X_DATA_POINTS<Y_DATA_POINTS) {isizeS=X_DATA_POINTS;}
//Allocate arrays
U=malloc(Y_DATA_POINTS*X_DATA_POINTS*sizeof(double​));
S=malloc(2*isizeS*sizeof(double));
V=malloc(Y_DATA_POINTS*X_DATA_POINTS*sizeof(double​));
AnalisisError = SVDEx (adAbsMap, Y_DATA_POINTS, X_DATA_POINTS, FULL_SIZE, U, S+isizeS, V);
FATAL RUN-TIME ERROR:   "Visualize_12.c", line 2451, col 17, thread id 0x00000E18:   The program has caused a 'General Protection' fault at 0x0342BC16.
Any help will be very much appreciated.
J. Hodak

Hi,
Thanks for trying to find an answer. I just realized now where the probem was. My mistake was when i allocated the arrays for holding the matrices. Because i was assking SVDEx to carry out FUL SIZE decomposition I must declare the arrays U and V to be , Y_DATA_POINTS*, Y_DATA_POINTS doubles and X_DATA_POINTS*, X_DATA_POINTS doubles respectively. My code was wrong, I was declaring the sizes to be smaller than necessary and  "Visualize_12.c", line 2451, was the call to SVDEx, and col 17 was pointing t that mistake. It took me a while to realize this because the error message did not exlicitly specify that the size or the array passed was too small. Now it is working well. But I believe that it will help to have an example to get started with this.
Thanks again,
Fundadero.

Similar Messages

  • How to use the checksumdll.lib in LabWindow/CVI to create CRCChecksum();

    Hi All,
    Any one know how to use the checksumdll.lib in LabWindow/CVI to create CRCChecksum() ?
    Thank you.

    Do you ave some documentation about that dll?
    Have you looked into dll properties searching for vendor name? Maybe you can look int vendorìs site and obtain some help.
    Ultimately: are you forced to use that dll or can you use any software to calculate the checksum? There are several CRCs that you can use: provided you know which is the type used you could find an algorithm to calculate the CRC and check an existing one.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to use the Table Function defined  in package in OWB?

    Hi,
    I defined a table function in a package. I am trying to use that in owb using Table function operator. But I came to know that, owb R1 supports only standalone table functions.
    Is there any other way to use the table function defined in a package. As like we create synonyms for functions, is there any other way to do this.
    I tryed to create synonyms, it is created. But it is showing compilation error. Finally I found that, we can't create synonyms for functions which are defined in packages.
    Any one can explain it, how to resolve this problem.
    Thank you,
    Regards
    Gowtham Sen.

    Hi Marcos,
    Thank you for reply.
    OWB R1 supports stand alone table functions. Here what I mean is, the table fucntion which is not inculded in any package is a stand alone table function.
    for example say sample_tbl_fn is a table function. It is defined as a function.It is a stand alone function. We call this fucntion as "samp_tbl_fn()";
    For exampe say sample_pkg is a package. say a function is defined in a package.
    then we call that function as sample_pkg.functionname(); This is not a stand alone function.
    I hope you understand it.
    owb supports stand alone functions.
    Here I would like to know, is there any other way to use the functions which are defined in package. While I am trying to use those functions (which are defined in package -- giving the name as packagename.functionname) it is throwing an error "Invalid object name."
    Here I would like know, is there any other way to use the table functions which are defined in a package.
    Thank you,
    Regards,
    Gowtham Sen.

  • How do I use the print function to output a numeric variable with a fixed amount of leading zeroes

    I need to create an output from a T-SQL query that picks a numeric variable and uses the print function to output with leading zeroes if it is less than three characters long when converted to string.  For example if the variable is 12 the output should
    be 012 and if the variable is 3 the output should be 003.
    Presently the syntax I am using is PRINT STR(@CLUSTER,3) .  But if @CLUSTER which is numeric is less than three characters I get spaces in front.
    Please help!

    >> I need to create an output from a T-SQL query .. <<
    NO! NO! In RDBMS, we have a presentation layer that handles displays. We do not ever do it in the database. This is fundamental. But more than that, the purpose of PRINT is for debugging in T-SQL and never for output.
    You are still writing 1960's COBOL or BASIC, but you want to to it in SQL.  You probably picked the wrong data type (a numeric that should be a string) and are trying to repair your design error.  
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • TS1398 I have an iPad mini, because of my work network firewalls I am not able to use the airprint function to print. I was told you can direct connect to a printer. I am not sure how as I have not seen any cables for a lightning connection to a printer c

    I have an iPad mini, I am connected to my work wireless connection. My printer also is on the same wireless network, however I am not able to print to my airprint enabled printer through this wireless connection. Is there a way to direct connect to the printer via a cable ?
    I am missing something here on the connection. I am thinking possibly a firewall here at work will not allow me to use the airprint function. Help ?

    There is no support for wired printing.
    It is probably a firewall issue, possibly where all inbound communications are blocked. Since you're at work, I'd call your work IT department and find out from them what you can/can't do.

  • Does anyone know how to use the bcc functionality for apple mail while accessing it on the cloud from my PC?

    I am currently away from my MAC and want to send an email through apple mail with the bcc functionality.  I am using the cloud to get to my mail, however, I can't figure out how to use the BCC functionality, please help.  Thanks!

    Open your mail,
    lower left corner click on settings,
    go to composing and check BCC, save and your done

  • How to Use the language function for assignment and validation

    Hi All,
    If anyone can explain me in details with example ,how to use the language function for assignments and validations?
    Thanks
    Arnab

    Hi Arnab,
    The expression is checked only for the current MDM session.
    If u login with the ABC language it will always show the ABC language no matter how many times u execute it.
    Try connecting to the DM with the XYZ language.
    It should go to the if part rather than else.
    Hope it helps.
    Thanks,
    Minaz

  • How to use the CMS functionality in Sun Portal Server 7.2

    Hi All,
    How to use the CMS functionality using the ccd.war(Portlet) which is available in the library as i could add it to my channel but not able to show the functionality as it is showing the error msg "You are currently not logged in. Please login." should I create userid and there respective roles inorder to use the CMS functionality.
    Has any one used this as I could this in glass fish server.
    Any Input is appreciated.
    Thanks & regards
    Srikanth

    Have a look at the "*Roles*" section of the portal server 7.2 content management system guide
    http://docs.sun.com/source/820-4275/index.html . You can also look at [project mirage|https://mirage.dev.java.net] for some screencasts
    Alternatively,
    1. ccd.war has 3 portlets in it:
    (a) custom content definition portlet
    (b) custom content portlet
    (c) workflow portlet
    2. Inorder to work with these portlets, user needs to be in anyone of the below roles:
    (a)Consumer (b) Editor (c) Approver (d) Administrator (e) Submitter (f) Contributor (g) Publisher
    3. By default ccd.war gets deployed using a default roles file (/var/opt/SUNWportal/tmp/ccd.roles.properties)
    Note: In windows, you may not find this file
    4. Access the portlets as a user in any of the role mentioned in the ccd.roles.properties
    (OR)
    you can use a new roles file which has mapping to your custom roles. For this , undeploy existing ccd.war and deploy again with a new roles.properties file
    Hope this helps!

  • How to use the divide() function in bpel

    Hi All,
    How to use the divide() function in bpel.
    pls can u give the one sample example

    2 div 4
    Eg;
    <assign name="Assign_1">
    <copy>
    <from expression="2 div 4"/>
    <to variable="outputVariable" part="payload"
    query="/client:testProcessResponse/client:result"/>
    </copy>
    </assign>
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to use the pps function from JCOP?

    Hi
    I'm trying to use the pps function from JCTerminal (JCOP API: [url http://www.cs.ru.nl/~woj/jcopapi/com/ibm/jc/JCTerminal.html#pps(int, int)]pps function ) to connect my client to a virtual card with a specific protocol (T=0).
    But I always got the error: "Protocol and parameter selection not supported by this terminal!"
    I've tried to make an ATR that support both protocol : [url http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc]3B 90 95 80 81 1F C7 DC.
    I really don't know what value to put in the second parameter (baud rate), I've tried with 150000, which is in the range of the ATR but I'm not sure this is correct. And I could't find any example of it.
    I'm also not sure where to put the pps command, the specification say directly after a reset, so I tried this implementation:
    System.out.print("Start");
              readers = TerminalFactory.getDefault().terminals().list(State.CARD_PRESENT);
              //If no readers has a card it ends the process
              if(readers.isEmpty()){
                   System.out.println("\nNo card in the reader...");
                   return;
              System.out.println("\nReader Type: "+readers.get(0).toString());
              term = (PCSCJCTerminal)JCTerminal.getInstance("PCSC", readers.get(0).toString().substring(15));
              term.open();
              System.out.println("\nTerminal opened");
              //Getting the ATR
              atr = new ATR(term.waitForCard(2000));
              try {
                   term.pps(JCTerminal.PROTOCOL_T0, (int)150000);
              } catch (Exception e) {
                   e.printStackTrace();
              System.out.println("ATR: "+toHex(atr.getBytes()));
              //sending a data 11223344
              System.out.println("\nsending data: 11223344");
              byte[] responsesend = term.send(0,cmdsend,0,cmdsend.length);
              System.out.println("Response data is:" + toHex(responsesend));
              //close terminal
              term.close();
              System.out.println("\nTerminal closed");I've got this output on the console:
    <font size="2">StartReader Type: PC/SC terminal Virtual CAD Reader 0
    Terminal opened
    ATR: 3b 90 95 90 00 81 1f c7 cc
    sending data: 11223344
    <font color="red">Protocol and parameter selection not supported by this terminal!</font>
         at com.ibm.jc.JCTerminal.pps(Unknown Source)
         at com.test.essai.main(essai.java:46)
    </font>>
    And If I take a look at the data exchanged with the card:
    <font size="2">Running in Virtual Card mode...
    ATR: 3B909580811FC7DC
    Waiting for event (power: off, protocol: unknown/undefined)...
    Waiting for event (power: off, protocol: unknown/undefined)...
    Raw event data: 01
    Event: VCAD_EC_POWER_ON (0x01)
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_POWER_ON) ATR: 3b909580811fc7dc
    Raw reply data: 003b909580811fc7dc
    Sending reply...
    Waiting for event (power: on, protocol: unknown/undefined)...
    Waiting for event (power: on, protocol: unknown/undefined)...
    Raw event data: 06ff11957b
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: ff11957b
    Accepting any PPS request parameters: Protocol: t=1; FI=9, DI=5
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: ff11957b
    Raw reply data: 00ff11957b
    Sending reply...
    </font>>
    This (above) is the PPS command but not from the PPS function, it is always sent with protocol T=1
    <font size="2">Waiting for event (power: on, protocol: t=1)...
    Raw event data: 0501
    Event: VCAD_EC_SET_PROTOCOL (0x05) Protocol: t=1
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_SET_PROTOCOL)
    Raw reply data: 00
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 0600c10120e0
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 00c10120e0
    Handling protocol-specific command...
    Protocol block:
    NAD: 0x00
    PCB: 0xc1 (T1_S_BLOCK); S-Block type: T1_SBT_IFS_REQ
    LEN: 1
    INF:
    IFS: 20
    EDC: 0xe0
    Changing IFS(other) from 32 to 32
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 00e10120c0
    Raw reply data: 0000e10120c0
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 0600001300a404000d54657374436c69656e7441707000f0
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 00001300a404000d54657374436c69656e74
    41707000f0
    Processing app. command...
    App. block:
    NAD: 0x00
    PCB: 0x00 (T1_I_BLOCK); Seq. #: 0; More data: 0
    LEN: 13
    INF:
    00a404000d54657374436c69656e7441707000
    EDC: 0xf0
    cmd name: N/A (class #4)
    cmd: 00a40400 0d 54657374436c69656e74417070 70
    Responding with the reversed command data, SW is hardcoded to 90<INS>
    rsp: 707041746e65696c4374736554 90a4
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 00000f70704
    1746e65696c437473655490a475
    Raw reply data: 0000000f707041746e65696c437473655490a475
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 060040041122334400
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 0040041122334400
    Processing app. command...
    App. block:
    NAD: 0x00
    PCB: 0x40 (T1_I_BLOCK); Seq. #: 1; More data: 0
    LEN: 4
    INF:
    11223344
    EDC: 0x00
    cmd name: N/A (class #1)
    cmd: 11223344
    Responding with the reversed command data, SW is hardcoded to 90<INS>
    rsp: 9022
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 0040029022f
    0
    Raw reply data: 000040029022f0
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 03
    Event: VCAD_EC_POWER_OFF (0x03)
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_POWER_OFF)
    Raw reply data: 00
    Sending reply...
    Waiting for event (power: off, protocol: unknown/undefined)...
    </font>>
    If someone know how to use this function or have any advice to help me to select a specific protocol with Jcop API, please let me know.
    If you you need any more information don't hesitate to ask.
    Best regards
    Edited by: Cyril on Sep 22, 2011 9:54 AM

    -1
    I'm using a virtual terminal (windows driver), and I don't see how I could turn off the Auto-pps. I've also tried with a real reader and a card and I have the same error.
    -2
    I've tried value in the range of the atr (based on this analysis: [url http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc]http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc ). But I don't know if only I value of baud-rate is possible in the range. Anyway I just would like to change the protocol, not the baud-rate.
    -3
    I've already tried to call pps function before, after the first reset, or with another reset later and I always got the same thing.
              term = (PCSCJCTerminal)JCTerminal.getInstance("PCSC", readers.get(0).toString().substring(15));
              term.open();
              System.out.println("\nTerminal opened");
              //Getting the ATR
              atr = new ATR(term.waitForCard(2000));
              System.out.println("ATR: "+toHex(atr.getBytes()));
              jcard = new JCard(term,atr,0);
              jcard.reset();          
              try {
                   term.pps(JCTerminal.PROTOCOL_T0, (int)312500);
              } catch (Exception e) {
                   e.printStackTrace();
              }The same pps is always send after each reset...

  • How do I find out what year my MacBook Pro is?  I want to know if I can use the mirroring function with my Apple TV if I download Mountain Lion.

    I'm trying to find out if I can use the mirror function to look at large construction drawings using my Apple TV.  It says that my MacBook Pro has to be early 2011 or newer and I can't remember what it is.

    Mactracker - Get Info on any Mac

  • How can I use the "EvalScript()" function? I am trying to send text to a Director app from the web browser, but the console in the browser just responds "Uncaught ReferenceError: evalScript is not defined ".

    I am trying to control a Shockwave app form another machine, using "Pusher" service (websockets), and everything is ok so far; but when I try to send the shockwave app the text recieved from another machine, using the "EvalScript()" function (as documented), I only get the message "Uncaught ReferenceError: evalScript is not defined" in the browser's console. What am I doing wrong?
    'm using the following script in the webpage where the shockwave object is located:
      <script type="text/javascript">
        // Enable pusher logging - don't include this in production
        Pusher.log = function(message) {
          if (window.console && window.console.log) {
            window.console.log(message);
        var pusher = new Pusher('abc963cf3e6g678879e');
        var channel = pusher.subscribe('Galileo_channel');
        channel.bind('Galileo_event', function(data) {
          evalScript(data.message);
      alert(data.message);
      </script>
    The "alert" is working fine, but I can't get JavaScript to recognize the EvalScript (I even tried calling the shockwave object, ie: "extev01.evalScript()", since the object's ID is extev01, but it doesn't work, either).
    Help!

    Thanks Sean.
    I tried your suggestion first, using getNetText to poll the server and read a text file. The drawbak is that I had to poll the server constantly, since I could not know in advance when the text file was going to change (and it's not practical to stump the server and connection).
    I've kept trying the EvalScript, asigning the Shockwave object to a variable first, then calling the EvalScript() in the object, but it doesn't work, either. I think I will simply use JavaScript and forget about shockwave altogether, since everything is working fine up to that point (although it would be nice to be able to use Lingo for the rest of the app).

  • Just installed a HP Color Laserjet CM2320nf MFP printer, at the same time I upgraded to Lion. It prints fine, but I cannot use the scan functions.  I downloaded the most recent driver! Any help would be appreciated.

    Just installed a HP Color Laserjet CM2320nf MFP printer, at the same time I upgraded to Lion. It prints fine, but I cannot use the scan functions.  I downloaded the most recent driver! Any help would be appreciated.

    HP says that the drivers for your all in one print/scanner are downloadable from apple. For the scanner to use preview. image capture or the scan icon from the print driver queue.  I don't know how old your HP is, but I know that the newer Os from apple don't support a lot of older printers. You might be able find a third party driver that could work.

  • Scanning in Mavericks? I can no longer use the scanning function in my HP Officejet 4500. HP says to go through Preview, Image Capture, or Print/Scan in System Prefs. Still doesn't work. Any ideas/similar experiences?

    Scanning in Mavericks? I can no longer use the scanning function in my HP Officejet 4500.
    HP says to go through Preview, Image Capture, or Print/Scan in System Prefs.
    Still doesn't work. Any ideas/similar experiences?

    Sure it is, yet it's called HP LaserJet Professional M1210nf MFP Series *
    Today, I followed your other advice, and deleted the printer, deleted the /Library/Printer/hp folder, downloaded the entire set of driver, re-installed the printer twice, once with the driver, once with Bonjour.
    The Bonjour Printer has the scan option active, but it is doesn't work (refer to above.), it is called M1217nfw
    The Apple Driver Printer doesn't show the scan option at all, it is called M1217nf (as on the http://support.apple.com/kb/HT3669#HP list.) This model number doesn't exist, as far as I can tell. 
    Still, everything works perfectly in Snow Leopard, for a MF printer that has been manufactured years after Snow Leopard was released.
    Why going up in software version means going backwards in compatiblity for brand new product is really the question that puzzles me here.

  • How do I reorganize my photos on iPad 2?  I need to move (not copy) photos from one album to another.  When I use the copy function to another album, and then try to delete an image from the original album, the system wants to delete the photos from all a

    How do I reorganize my photos on iPad 2?  I need to move (not copy) photos from one album to another.  When I use the copy function to another album, and then try to delete an image from the original album, the system wants to delete the photos from all albums.  Please help.

    You can't do it directly on the iPad - the new album functionality basically only allows you to copy photos into those new albums, you can't move them. The way that I think of it as working is that you are just creating pointers to the photos in those new albums, so if you then delete the original photo on the iPad you therefore automatically delete all the pointers to it.
    If you want to re-organise your albums then you will need to do it on your computer and then sync those albums over to the iPad

Maybe you are looking for