Thread: Visatype error, unknown type name ViUInt64

  1. #1
    Registered User
    Join Date
    Jan 2020
    Posts
    1

    Visatype error, unknown type name ViUInt64

    Code:
    #include <stdio.h>
    #include <visa.h>
    int main () {
    ViSessiondefaultRM,vi;
    char buf [256] ={0};
    
    viOpenDefaultRM(&defaultRM);
    viOpen (defaultRM, " USB0::0x0957::0x0607::MY47021232::INSTR",VI_NULL,VI_NULL, &vi);
    /* Initialize device*/
    viPrintf (vi,"*RST\n");
    /* Send an *IDN?string to the device */
    viPrintf (vi,"*IDN?\n");
    /* Read results */
    viScanf (vi,"%t", &buf);
    /* Print results */
    printf("Instrument identification string: %s\n", buf);
    /* Close session */
    viClose (vi);
    viClose (defaultRM);
    }
     
    
      //Using Code Blockers 17.12
    //Win10 64bit
    //GNU GCC Complier(x64)
    
    //when I run above code, the Visatype.h code opens up instead, and seems to point to the bit of code below in VisaType.
    
     
    //typedef ViUInt64 _VI_PTR Vi PUInt64
    
    
    //Error: unknown type name ViUInt64
    Last edited by Salem; 1 Week Ago at 12:42 AM. Reason: train-wreck crayola formatting fixed

  2. #2
    Registered User
    Join Date
    Dec 2017
    Posts
    782
    Using Code Blockers
    Are ya?

    VisaType
    Don't tell us anything about it.
    Don't give a website link or anything.
    Everybody knows what VisaType is, of course.
    I use it every day!

    Anyway, it's obviously an error in the header code. Or else you're supposed to include something else before visa.h, although that's not usually the case. Another possibility is that you're supposed to define some macro(s) to indicate what types to use.

    Try downloading the thing again and if it still doesn't work, RTFM.
    The world hangs on a thin thread, and that is the psyche of man. - Carl Jung

  3. #3
    Registered User
    Join Date
    Jan 2020
    Posts
    2
    I read the FM, FAH!

  4. #4
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    191
    in visatype.h :

    Code:
    #if defined(_VI_INT64_UINT64_DEFINED)   
      typedef ViUInt64    _VI_PTR ViPUInt64;
      typedef ViUInt64    _VI_PTR ViAUInt64;
      typedef ViInt64     _VI_PTR ViPInt64;
      typedef ViInt64     _VI_PTR ViAInt64;
    #endif
    Last edited by Structure; 1 Week Ago at 10:36 AM.
    "without goto we would be wtf'd"

  5. #5
    Registered User
    Join Date
    Jan 2020
    Posts
    2

    Code not building without error

    I really don't understand! I like to struggle and figure it out, but now I have spent at least 3days trying to get this code to work. I can communicate with my DMM using LabVIEW, Visual Studio and Pycharm. But not able make code blockers IDE work with this code. Can somebody explain to me what I am missing? Everytime I run the code it always ignores my code and error to visatype. If I disable Visa.h in my code it runs error to the ViSession default RM, VI;. Am I missing a macro that defines parts of my code? Does my code look like it should work. My visatype is exactly like below.

    #if defined(_VI_INT64_UINT64_DEFINED)
    typedef ViUInt64 _VI_PTR ViPUInt64;
    typedef ViUInt64 _VI_PTR ViAUInt64;
    typedef ViInt64 _VI_PTR ViPInt64;
    typedef ViInt64 _VI_PTR ViAInt64;
    #endif
    Last edited by iceman56; 1 Week Ago at 12:06 PM. Reason: Respond

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    3,729
    Did you try defining "_VI_INT64_UINT64_DEFINED"?

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    3,729
    Looks like you might have a Compiler issue; as in the compiler you are using might not be compatible with what you are trying to build!

    I suggest RTFM and seeing what compilers are supported!

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  8. #8
    Registered User
    Join Date
    May 2009
    Posts
    3,729
    Looks like LibreVISA should work with GCC under Debian. Not sure about 64 bit Windows OS Mingw GCC.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  9. #9
    Registered User
    Join Date
    May 2009
    Posts
    3,729
    You did built LibreVISA with the same Compiler you are trying to build the client code, correct?

    Edit: The library looks like no progress in about 6 years.

    Tim S.
    Last edited by stahta01; 1 Week Ago at 07:12 PM.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help I am stuck with an unknown type of error.
    By ChaturBauka in forum C Programming
    Replies: 4
    Last Post: 01-02-2019, 07:33 AM
  2. Unknown error with Y/N type system.
    By JoshLalonde in forum C Programming
    Replies: 15
    Last Post: 02-14-2013, 04:51 PM
  3. unknown file type reading
    By xixonga in forum C Programming
    Replies: 20
    Last Post: 11-28-2010, 12:17 PM
  4. Error-size of te type is unknown
    By as_rule in forum C Programming
    Replies: 5
    Last Post: 08-29-2010, 08:28 AM
  5. unknown size for type 'void'
    By Noobwaker in forum C Programming
    Replies: 12
    Last Post: 04-05-2006, 06:41 AM

Tags for this Thread