login about faq

Hi,

I am pretty new to this game so just getting my head around it all.

I have a program written in Beckhoff's TwinCat PLC control program. We are using PC based automation.

My issue is I have this structure declared:

TYPE T_GPGGA :
STRUCT
    sUTC            :STRING(9);
    sLat            :STRING(7);
    sLatDirection   :STRING(1);
    sLong           :STRING(7);
    sLongDirection  :STRING(1);
    sGPSQuality     :STRING(1);
    sNumSats        :STRING(1);
    sHDOP           :STRING(4);
    sAltitude       :STRING(6);
    sGeodSep        :STRING(6);
    sDiffAge        :STRING(5);
    sDiffStationID  :STRING(4);
END_STRUCT
END_TYPE

Now I want to make a global variable (ideally a global constant) of type T_GPGGA and assign values to each string within the structure.

I realise now it could have been done with an array, but that would require changing a bunch of code (which I will probably do in a while), but just interested to know if I can assign values when creating an instance of a structure, or only when I define the type.

Thanks Steve

asked Dec 13 '11 at 10:28

StephenMartin's gravatar image

StephenMartin
1

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1
×1
×1
×1
×1

Asked: Dec 13 '11 at 10:28

Seen: 94 times

Last updated: Dec 13 '11 at 10:28

Related questions