#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    3
    Rep Power
    0

    A question about structures and functions in C++


    I have a rotator for satellite tracking and it's possible to program it using C++.

    This file, which is provided by the manufacturer, contains a different structures and functions, but I don't know how to use it to program the rotator, I'm a newbie in C++. I am a new user, so I can't attach the file :(

    I just like to know what should I do with these structs and functions in order to start programming the rotor to point out a certain position, then I'll try to write the code. Should I create a library or something similar?

    Thank you in advance
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,255
    Rep Power
    2222
    Basically, what the manufacturer gave you is a library. Those structures are used to contain the settings and values pertaining to the rotator and its operations and its data outputs. Those functions are used to manipulate those structures among other things.

    With most products I've seen in the past, the manufacturer includes documentation about the data structures and functions that they provide in the library, along with application notes which describe how to apply that library to an actual, albeit simple, project. At the very least, there would be at least one sample program. Such examples would include code for initializing the data structures and the hardware, for either commanding the hardware or reading data from it, and maybe something about shutdown/clean-up.

    If you did not get any application notes or examples, then you might find some on the manufacturer's website. Or you could ask the manufacturer's salesman. At the very least, do read the documentation that you did receive -- again, go to the manufacturer's website for that documentation if you hadn't actually been given any yet. Familiarize yourself with the data structures and with the library functions and you will start to get an idea of what their uses would be, especially if they had given them meaningful names.

    You're new with C++, but are you familiar with C? Are those structures and functions the same (largely) as what you're used to working with in C? Or are those "structures" actually classes and those "functions" actually methods which are members of those classes? IOW, is this an object-oriented programming (OOP) library that you were provided?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    3
    Rep Power
    0
    Ok, I understand. But how can I create the library using the structs and functions? Other way to program it is using Delphi (Pascal), because the manufacturer provides the library and a test application using this language, so I just need to make slight changes in that application if I program it using Delphi. What do you recommend me, program it in C++ or Delphi?

    Thanks for your previous answer

IMN logo majestic logo threadwatch logo seochat tools logo