Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6881309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:05:29+00:00 2026-05-27T05:05:29+00:00

When I trace my program (online with breakpoint and singlestep) I see, that the

  • 0

When I trace my program (online with breakpoint and singlestep) I see,
that the VAR SOpen becomes “* INVALID: 16#02 *” when the line Step:=Step+1; is reached.

Watching the trace more careful, I saw, that Step changes from 0 to 1, in the first call of “0:”. The two VARs are the two initialized and seem to be linked together. The aditional increase sets Step to 2 (in the 1st run!) and SOpen to invalid.

PROGRAM PLC_PRG
VAR
    SerIO: SERCOMM;
    Step: BYTE := 0;
    Input: ARRAY [0..50] OF DWORD;
    SOpen: BOOL := FALSE;
END_VAR

IF Eingang1 THEN
    CASE Step OF
    0:
        IF NOT SOpen THEN
            SerIO.FB_ACTION := Open;
            SerIO.RECEIVE_BUFFER:=Input[0];
            SerIO.COMPORT:=1;
            SerIO.EN:=TRUE;
            Ausgang1 := NOT SerIO.ERROR;
            SOpen :=TRUE;
            SerIO.EN:=FALSE;
        END_IF;
    1:
        IF SOpen THEN
            SerIO.FB_ACTION:=Read;
            SerIO.EN:=TRUE;
            Ausgang1 := NOT SerIO.ERROR;
            Ausgang2 := (SerIO.BYTES_DONE>3);
            SerIO.EN:=FALSE;
        END_IF;
    2:
        IF SOpen THEN
            SerIO.FB_ACTION:=Close;
            SerIO.EN:=TRUE;
            Ausgang1 := NOT SerIO.ERROR;
            SOpen :=FALSE;
            SerIO.EN:=FALSE;
        END_IF;
    END_CASE
    Step:=Step+1;
    IF Step>2 THEN Step :=0; END_IF;
ELSIF SOpen THEN
    SerIO.FB_ACTION:=Close;
    SerIO.EN:=TRUE;
    SerIO.EN:=FALSE;
    SOpen :=FALSE;
    Step:=0;
END_IF;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:05:29+00:00Added an answer on May 27, 2026 at 5:05 am

    I transferred the VAR now to VAR_GLOBAL. That’s not really what I want, but now it works. Better solutions are welcome and will be accepted 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to get the trace table for a Python program? Or
Say I make a program that keeps track of the days I worked and
How do you trace/profile your .NET applications? The MSDN online help mentions Visual Studio
I have a trace setup for SQL Server Profiler to monitor SQL that is
I have a program that depends on an external shared library, but after a
I'm using .NET's built-in Tracing mechanism to trace program execution. The problem is the
I want to trace the http requests a program on my computer is making,
I have a program written in C that runs on Linux, MacOS and Windows.
I'm trying to make a tracking program for an online game, and I need
I debugged the program and observed that it is stopped when it wants to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.