0% found this document useful (0 votes)
10 views8 pages

Assessment (Data Types-Scripts) 1

The document contains a series of questions and tasks related to data types, logic gates, and scripting in programming. It covers topics such as the range of signed and unsigned integers, appropriate data types for storing values in SCADA, and the evaluation of Boolean expressions. Additionally, it includes scripts that require the reader to determine the resulting values of variables after execution.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views8 pages

Assessment (Data Types-Scripts) 1

The document contains a series of questions and tasks related to data types, logic gates, and scripting in programming. It covers topics such as the range of signed and unsigned integers, appropriate data types for storing values in SCADA, and the evaluation of Boolean expressions. Additionally, it includes scripts that require the reader to determine the resulting values of variables after execution.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Name:

Data Types:

1. What is the typical range of a 16-bit signed integer, and how does it differ from an unsigned
integer? (just show the working, not need to provide the actual number)

2. We need to store value of an Analog Pressure Transmitter in SCADA, what data types can be
used to store the value typically?

A. Bool
B. Integer
C. String
D. Float

3. We need to store value of a Pressure switch in SCADA, what data types can be used to store the
value typically?

A. Bool
B. Integer
C. String
D. Float

4. A value of “14.75” can be stored in the following data types only:

A. Bool
B. Integer
C. Float

5. There is a floating-point Tag A with value 14.75 and there is an integer Tag B with value 15.
What will be the answer to the following script?

B=A;

6. Convert the binary (base 2) number 00101001 into Decimal (Base 10)
7. Convert the following hexadecimal (base 8) number 01001 into Decimal (Base 10)

Logic Gates:

8. Provide response (true or false) to the following expressions, considering Boolean tags A, B, C &
D:

a) (A OR B) AND (C OR D)
[A=TRUE, B=FALSE, C=FALSE, D=FALSE]

b) (A AND B) AND (C OR D)
[A=TRUE, B=FALSE, C=FALSE, D=FALSE]

c) (A AND B) OR (C AND D)
[A=TRUE, B=FALSE, C=FALSE, D=TRUE]

d) A AND (B and (NOT C))


[A=TRUE, B=TRUE, C=FALSE, D=TRUE]

e) C XOR D
[A=TRUE, B=TRUE, C=FALSE, D=TRUE]
Logical Expressions & Scripting:

9. Provide response to the following scripts:

Script A:

Dim A,B,C,D as integer;

Dim E as Bool;

E=false;

A=0;B=0;C=0;D=0;

If E==false then

A=12;

B=14;

Else

C=130;

D=140;

Endif;

Provide the values of A,B, C & D after this script is executed.


Script B:

Dim A,B,C,D as integer;

Dim E as Bool;

E=false;

A=0;B=0;C=0;D=0;

If E==false then

A=12;

B=14;

E=true;

Else

C=130;

D=140;

Endif;

Provide the values of A,B, C & D after this script is executed.


Script C:

Dim A,B,C,D as integer;

Dim E as Bool;

E=false;

A=5;B=10;C=15;D=20;

If A=5 AND B=10 then

E=true;

Elseif C=15 AND D=20

E=false;

Endif;

Provide the value of E after this script is executed


Script D:

Dim A,B,C,D as integer;

Dim E as Bool;

E=true;

A=5;B=10;C=15;D=20;

If A=5 AND B=11 then

E=true;

Elseif C=15 OR D=21

E=false;

Endif;

Provide the value of E after this script is executed


Script E:

Dim A,B,C,D as integer;

Dim E as Bool;

E=true;

A=5;B=10;C=15;D=20;

If A=5 AND B=10 then

E=false;

If C=15 AND D=20 then

E=true;

Endif;

Endif;

Provide the value of E after this script is executed


Script F:

Dim str as string;

Dim index as integer;

Str=””; index=0;

For (index = 0 , index <=10, index=index+1)

if index >=3 then

str=str+int

Provide the value of E after this script is executed

You might also like