Jump to content

fillalph

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Posts posted by fillalph

  1. I am looking to write a dll that performs some math operations for a RT system on cRIO 9012. The C (dll) code is compiled in using the GNU tool chain for VxWork.

    I figured to start small with a basic dll and once I had that working and was comfortable expand on it. I am running into a couple hiccups though.

    Here is the dll file

    #include <stdio.h>   #include <stdlib.h>   #include <math.h>      extern "C"    {	   double testDLL(double arg_A, double arg_B)	   {		   return(arg_A + arg_B);	   }   } extern "C" double testDLL(double arg_A, double arg_B);

    and here is the test vi program I wrote

    post-5846-1238515688.jpg?width=400

    When I right click on the call library function on the block diagram and configure the parameters, they are set as follows.

    return type has the type "Numeric"

    arg1 has the type "Numeric" and data type "Signed 32-bit Integer" and pass by "Value"

    arg1 has the type "Numeric" and data type "Signed 32-bit Integer" and pass by "Value

    What I don't understand is what the return type is the same as arg 1.

    Any insights?

    Thanks in advance.

    -fillalph

  2. Hi Gabi,

    I wasn't able to implement what you were saying, but I did manage to get the code to work. I was curious if someone could help "optimize" the code. Having so many local variables seems like a waste. I don't really need to optimize the code for my application, I am more or less looking to learn.

    Thanks,

    fillalph

  3. Hello Everyone,

    I have uploaded my VI along with a picture of what the output is at the end.

    I am able to acquire data correctly, no problem with that. The problem I am having is that "Array_Editted" is empty (the 2nd sequence in my code isn't working properly). I tried to step through the code to see where the problem was, but that didn't help. When looking at the probe of array_editted, the values are greyed out.

    Any suggestions would be greatly appreciated. I have a feeling I am going to feel like an idiot when I figure it out :S

    Thanks :)

    fillalph

  4. Hello Everyone,

    I have uploaded my VI along with a picture of what the output is at the end.

    I am able to acquire data correctly, no problem with that. The problem I am having is that "Array_Editted" is empty (the 2nd sequence in my code isn't working properly). I tried to step through the code to see where the problem was, but that didn't help. When looking at the probe of array_editted, the values are greyed out.

    Any suggestions would be greatly appreciated. I have a feeling I am going to feel like an idiot when I figure it out :S

    Thanks :)

    fillalph

  5. Hello Ton.

    Thanks for your reply. At first I tried to apply what you said in my program and got lost. Then I went back to your display picture and tried to set that up.

    I do have a question about your block diagram though.

    How did you get your cluster to have the type display "Status 2"? Mine will only display abc or I32 for example (see my block diagram).

    Thanks,

    Philip

    post-5846-1159269732.jpg?width=400

  6. First, I would like to thank Ulrich and ooth. Their suggestions here really helped throughout the rest of my program. I had most of the programming working, but I wanted to make some changes to it to make the code easier to look at.

    One addition was the a subvi to create the file name based on input from the user. The properties from the laser (which were being cycled through in that while loop) make up the name.

    The way I used to do it was just take the properties out from the loop and add underscores in the main program. This works, but it looks ugly and can hard to follow. I tried to clean it up and make it easier in case someone later wants to add other properties to the filename.

    The problem now is that the subvi filename.vi starts without any of the variables waiting outside. I thought in Labview that nothing could run until all of the information was ready? Now, I know I asked a question, but I think it has to do with the fact that I disabled indexing. However, when I enable indexing, I get an error that the type cast is wrong because from the loop it needs an array and the subvi is an element.

    Any suggestions on a fix.

    Thanks

    Philip

    Download File:post-5846-1159259916.vi

    post-5846-1159259927.jpg?width=400

  7. Hello,

    Before asking my actual question I would like to make a couple of comments.

    1. This is truly a beginners question. I tried googling for help with arrays as well as the ni.com website for examples, but couldn't find anything.

    2. I searched in this forum, but most of the questions here are far more advanced and difficult than what I am asking.

    I am university student working abroad at a university in Germany for an 8 month coop term. I am writing this program to automate one of our experiments. [Note: not really relevant to the question, just explaining the program quickly -- most welcome to skip this part]. After entering the values on the front panel (most of this information is just used in the header) the program will set the voltage on the pulsar and then read two voltages across the laser from an oscilliscope). The voltages will be saved to an ascii file with the comment file.

    My problem (at the moment) is storing the values from the front panel in an array.

    The program starts and the for loop initializes running through the case structure which holds various variables.

    The values will be concatenated into a string and then stored in an array <-- problem is here.

    Do I have to create a local variable that points to my array for the input?

    I hope my question/problem was described adequately.

    I feel so embarrassed asking this, but I am stuck. :unsure:

    Thanks in advance for any tips,

    Philip

    Download File:post-5846-1155294692.llb

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.