|
How should I make device driver
settings in the project?
Go to project directory. Open project.ini
file residing in this directory in notepad. Edit [Protocol]
section. Check where the PLC or device is connected (to
COM1 or COM2), accordingly assign driver name to COM1 or
COM2 also set Baud Rate, Data length, Stop Bits, Parity,
Flow in[COM1] or/and [COM2] section.
e.g. [PROTOCOL]
COM1=MODBUS
COM2=NONE
[COM1]
Baud Rate=19200
Data Length=8
Stop Bits=1
Parity=Even
Flow=DTR,RTS
[COM2]
Baud Rate=9600
Data Length=8
Stop Bits=1
Parity=Even
Flow=DTR,RTS
|
|
How should I write Recipes?
Create file named RECIPE.INI in notepad. Enter
name of the recipes and then set of parameters in the following
format.
Contents of RECIPE.INI:
[RECIPE_NAME1]
TEMPERATURE=80
PRESSURE=4
WATER_LEVEL=120
[RECIPE_NAME2]
TEMPERATURE=100
PRESSURE=3
WATER_LEVEL=140
This is a sample recipe containing two different recipes
each containing 3 parameters. You can enter as many recipes
as you want. Number of parameters should not be exceeded
150. These parameters must be defined as the tags in the
project.
To load and save recipes in runtime, create two memory
tags of type discrete with read and write access named
LOADSTATUS and SAVESTATUS. Create one button named Load
Recipe and write script on take action animation on it
as below. LOADSTATUS=LOADRECIPE(PROJECTDIR()+"\RECIPE.INI","RECIPE_NAME1");
This will load first recipe in runtime and to load second
recipe change the name of the recipe. Create one button
named Save Recipe and write script on take action animation
on it as below SAVESTATUS=SAVEREC1IPE(PROJECTDIR()+"\RECIPE.INI","RECIPE_NAME1");
This will save the parameter values in first recipe in
runtime and to save second recipe change the name of the
recipe. |
|
How should I establish a link
between ASTRA and third party DDE Server e.g. KEPware
DDE Server?
Install third party DDE Server. Install proper
device driver. Set communication parameters for the device
driver. Create a new topic/device in it. Create tag database
(PLC tags) in it. Save the project. This is what you have
to do in DDE server. Now install NET.DLL in ASTRA. Open
Config.Ini file from ASTRA directory in Notepad. Add following
lines in it at the end of file.
[DDE1]
APPLICATION=DDE_SERVER_NAME
TOPIC=DEVICE_NAME
NODE=NODE_NAME
Here DDE_SERVER_NAME is the actual name of DDE server.
In case of KEPware the name is KEPDDE. DEVICE_NAME is the
name of device you have created in DDE server or for which
you have created tag database in DDE server. NODE_NAME
is the node name defined in ASTRA.
Open configuration mode of ASTRA. Create a new project
in it. Go to Tools menu and click on Setup Nodes. Add a
new node with address 01 and driver selected as NET and
model ALL. Press Ok button and press Yes to Add node control
related tags automatically? Close the dialogue box of Setup
nodes. Go to Tools menu and click Edit Tag Database. Click
on Add New button. Add new tags in the tag database with
the same name what you have entered in DDE Server. Here
select Node as the new node what you have created for net
driver. Enter the address same as the tag name. Tag type
should be same as what was defined in DDE server. After
creating all tag database in this way save the project.
Now first run the project in DDE server. Then run project
in ASTRA. ASTRA will establish link with DDE server. DDE
server will dynamically exchange the data to ASTRA.
How should I established a DDE link between ASTRA and
excel running on the same machine? Or How should I exchange
data between ASTRA and Excel running on same machine?
Run ASTRA project. Open excel worksheet. Enter formula in one of the
cell as below
=DataManager|Tagtable!Tag_Name
Here Tag_name is the actual tag name from running project. E.g. If you
want to see Seconds from running project write cell formula as follows
=DataManager|Tagtable!Second
There is no limit for the number of tags for data exchange in excel. |
|
How should I connect two PLC
on two COM ports and mouse?
If the mouse is already connected to one of
the COM ports then disconnect it. Connect a new mouse on
PS/2 compatible mouse port. Install proper mouse driver
for PS/2 port from control panel. Restart the windows.
Now both the COM ports are free. You can connect two different
PLC on two COM ports and at the same time mouse will also
work.
How should I view all script, all tags, all window names
with object names and animations attached to it at a glance?
Close ASTRA if running. RUN ASTRA Quick View Utility from ASTRA folder
from program menu. Quick View Settings dialogue box will appear. Select
project path with Browse button. Enter Output file name. Check the options
for Script, Tags, Windows as required. Press OK button. Following files
will be created in the specified directory.
File_Name.SDP - Script dump file
File_Name.SMR - Summary of the options selected
File_Name.TDP - Tags dump file
File_Name.WDP - Window dump file |
|
How should I convert -- DLO
files residing in log directory of the project to --.TXT
format? Or How should I view --.DLO files residing in
log directory of the project?
Close ASTRA if running. Run ASTRA File Conversion
Utility from ASTRA folder from program menu. Click on DLO
TO TXT button on tool bar else go to File-Convert-DLO TO
TXT menu. Proprietary to Text dialogue box will appear.
There are two options for file conversion. Based on time
and All selected files. Check on the option whatever you
want. In Based on time you can specify duration for conversion.
In settings option select the log directory from project.
Enter start time and end time for file conversion. Then
press OK button.
You can also convert only selected files. Check on All
Selected Files. Click on select files. Open dialogue box
will appear. Select log directory from required project.
Select the required file. Press OK Then Click on OK button
from Proprietary to Text dialogue box. This will process
the selected log file and will convert --.dlo files to
--.txt files. Converted files will be in the same log directory.
This utility will also give Minimum, Maximum, Average,
Integral Tag value. Check on these option in this dialogue
box whenever required. Data can be sorted depending on
Tag based and time based. Check these option if required.
File output can be converted to Excel format by checking
the option Comma Separated Variable format. |
|
How should I connect ASTRA
in Client/Server or Master/Slave configuration?
First requirement is that ASTRA running on
two machine must be connected through windows network.
Following are the steps to do NETDDE settings.
Run application Regedit from windows directory. Registry Editor window
will appear on screen.
Go to HKEY_LOCAL_MACHINE - SOFTWARE - MICROSOFT - NETDDE - DDESHARES.
Right click on DDESHARES. Go to New - Key. Change name from New Key #1
to DATA$
Right click on DATA$. Go to New - DWORD Value. Change name from New Value
#1 to Additional Count.
Right click on DATA$. Go to New - String Value. Change the name from
New Value #1 to Application. Modify the property by right clicking on
the Application. Change value data to Data Manager. Press OK
Right click on DATA$. Go to New - String Value. Change the name from
New Value #1 to Item. Don't modify the property. Right click on DATA$.
Go to New - String Value. Change the name from New Value #1 to Password2.
Don't modify the property.
Right click on DATA$. Go to New - DWORD Value. Change the name from New
Value #1 to Permissions1. Modify the property by right clicking on the
Permissions1. Change value data to f. Press OK
Right click on DATA$. Go to New - DWORD Value. Change the name from New
Value #1 to Permissions2. Don't modify the property.
Right click on DATA$. Go to New - String Value. Change the name from
New Value #1 to Topic. Modify the property by right clicking on the Topic.
Change value data to Tag Table. Press OK That all.
Final directory structure of DATA$ should look like as follows.

Now run NETDDE application from windows directory. Then
run ASTRA project on this machine. This is Server or Master
configuration.
For client/slave configuration follow the same procedure as above for
NETDDE settings on another machine that is connected on network. After
completing NETDDE settings, install ASTRA if not installed already, also
install NET driver on this machine. Open Config.Ini file from ASTRA directory.
Enter following lines at the end of the file.
[DDE]
APPLICATION='\\MACHINE_NAME\NDDE$'
TOPIC='DATA$'
Here MACHINE_NAME is the of the machine on which Server/Master
ASTRA is running. Save the file and close it. Now run NETDDE
application from windows directory on this machine also.
Copy the project from Server machine. Open the project
in ASTRA configuration. Go to Tools - Setup Nodes. Edit
the already defined node. Select driver as NET and model
as ALL. Press OK Close the Setup Node dialogue box. Now
go to Edit Tag Database from Tools menu. Edit each and
every PLC tags. For these tags change the address same
as the tag name. Save the project and run it. This is a
client/slave configuration. This will display each and
every screen with real time data. But client/slave is not
able to write on PLC address. This is made for monitoring
only. Speed of updating of data depends on network traffic. |
|
How should I create historical
trend?
Create a new window with the name HIST_TREND
in ASTRA project. (If you are using some other name, use
the same name in programming also, here we are using HIST_TREND)Draw
trend in this window with the help of Tool Box. Edit the
properties of the trend. Trend name should be Trend1. (If
you are using some other name, use the same name in programming
also, here we are using Trend1.) Edit pen properties. Attach
different pen tags( of which you want to see Historical
Trend) to different pen numbers with the help of Tag button,
also select different Pen Color. You can change pen thickness
also. Press Accept button after selecting pen tags. Check
Enable Historical Display option. Click on Value Scale
tab. Change number of Main Grids and Sub Grid / Main Grid,
Value Scale limits i.e. Y scale as per requirement. Click
on Time Scale tab. Change number of Main Grids and Sub
Grid / Main Grid, Time Span i.e. X scale and Display format
as per requirement. Click on Colors Tab and choose Color
scheme for the trend. Press OK
Add following tags in tag database with the script given
below.
Name of the Tag: CURRENTPEN
Node: Memory.
Type: Unsigned Integer
Security: Read/Write.
Script:
HIST_TREND.TREND1.CURRENTPEN = CURRENTPEN;
Name of the Tag:- DRAWMODE
Node:- Memory
Type:- Unsigned Integer
Security:- Read/Write
Script:-
HIST_TREND.TREND1.DRAWMODE = DRAWMODE;
Name of the Tag:- MAXRANGE
Node:- Memory
Type:- Unsigned Integer
Security:- Read/Write
Script:-
HIST_TREND.TREND1.MAXRANGE = MAXRANGE;
HIST_TREND.TREND1.REDRAW();
Name of the Tag:- MINRANGE
Node:- Memory
Type:- Unsigned Integer
Security:- Read/Write
Script:-
HIST_TREND.TREND1.MINRANGE = MINRANGE;
HIST_TREND.TREND1.REDRAW();
Name of the Tag:- MODE
Node:- Memory
Type:- DISCRETE
Security:- Read/Write
Script:-
HIST_TREND.TREND1.MODE= MODE;
Name of the Tag:- TIMESPAN
Node:- Memory
Type:- Large Integer
Security:- Read/Write
Script:-
HIST_TREND.TREND1.TIMESPAN = TIMESPAN;
Name of the Tag:- SPAN
Node:- Memory
Type:- Unsigned Integer
Security:- Read/Write
Script:-
TIMESPAN = SPAN * 60;
Name of the Tag:- STARTDATE
Node:- Memory
Type:- String
Security:- Read/Write
Script:-
HIST_TREND.TREND1.STARTDATE = STARTDATE;
HIST_TREND.TREND1.REDRAW();
Name of the Tag:- STARTTIME
Node:- Memory
Type:- String
Security:- Read/Write
Script:-
HIST_TREND.TREND1.STARTTIME = STARTTIME;
HIST_TREND.TREND1.REDRAW();
Now close the Tag Browser. Add following button to HIST_TREND window.
Name of the Button:- MODE
First Animation:-Show Value
Tag Name:- Mode
Second Animation:-Take Action
Script:-
TOGGLE MODE;
This Button will between Real Time Trend and Historical Trend in Run
Time.
Name of the Button:- StartDate
First Animation:-Enter Data
Tag Name:- STARTDATE
(Here enter the date as per date format set in the computer in Run Time.)
Name of the Button:- StartTime
First Animation:-Enter Data
Tag Name:- STARTTIME
(Here enter the date as per date format set in the computer in Run Time.)
Name of the Button:- TimeSpan
First Animation:-Enter Data
Tag Name:- SPAN
With Low Value 0 and High Value 65000.
(Enter the span in minutes in Run Time i.e. duration for which data is
to be retrieved.)
Name of the Button:- Draw mode
First Animation:-Enter Data
Tag Name:- DRAWMODE
With Low Value 0 and High Value 2.
Meaning of this numbers in Run mode is
0 - Draws in Scatter mode. Plots only the data points along the line
of the graph.
1 - Draws in Discrete mode. Joins data points assuming the value is constant
till the next data point, thus giving the square waves.
2 - Draws in Smooth mode. Joins data points directly, thus giving a smooth
line. This is a default mode.
Name of the Button:- MinRange
First Animation:-Slider
Tag Name:- MINRANGE
Low Value - 0
High Value - 150 depending on minimum scale of Historical Trend.
Check the following options
Update Tag while sliding. Direction Vertical.
Click on Button in the column Related Position in front of Low Value.
Enter the button position for the Lower position of the slider. Click
on Button in the column Related Position in front of High Value. Enter
the button position for the Higher position of the slider. Press OK
Name of the Button:- MaxRange
First Animation:-Slider
Tag Name:- MAXRANGE
Low Value - 0
High Value - 1000 depending on maximum scale of Historical Trend.
Check the following options
Update Tag while sliding. Direction Vertical.
Click on Button in the column Related Position in front of Low Value.
Enter the button position for the Lower position of the slider. Click
on Button in the column Related Position in front of High Value. Enter
the button position for the Higher position of the slider. Press OK Your
Historical trend should look like as follows.
|
|
How should I create daily report
with hourly minimum and maximum values of the parameters?
Suppose you have three parameters V1, V2,
V3 and you want hourly minimum and maximum for these parameters.
These 3 tags are coming from PLC and you want to compare
each sample with previous one for calculating minimum and
maximum. Create following tags of same type as V1, V2,
V3
V1_MIN, V1_MAX, V1_0, V1_MIN_1, V1_MIN_2, V1_MIN_3
up to V1_MIN_23
and V1_MAX_1, V1_MAX_2, V1_MAX_3
up to V1_MAX_23 (0 to 23
subscript is for 24 hours.)
Similarly for V2 and V3
V2_MIN, V2_MAX, V2_0, V2_MIN_1, V2_MIN_2, V2_MIN_3
up to V2_MIN_23
and V2_MAX_1, V2_MAX_2, V2_MAX_3
up to V2_MAX_23
V3_MIN, V3_MAX, V3_0, V3_MIN_1, V3_MIN_2, V3_MIN_3
up to V3_MIN_23
and V3_MAX_1, V3_MAX_2, V3_MAX_3
up to V3_MAX_23
Go to File-Configure and click on Script. Check on Before Startup option.
Write following script on before startup of the Project
V1_MIN = V1;
V1_MAX = V1;
V2_MIN = V2;
V2_MAX = V2;
V3_MIN = V3;
V3_MAX = V3;
Press OK Close Project options. Now write following script on V1 tag.
IF (V1 < V1_MIN) THEN
V1_MIN = V1;
ENDIF;
IF (V1 > V1_MAX) THEN
V1_MAX = V1;
ENDIF;
IF (_HOUR == 0) THEN
V1_MIN_0 = V1_MIN;
V1_MAX_0 = V1_MAX;
ENDIF;
IF (_HOUR == 1) THEN
V1_MIN_1 = V1_MIN;
V1_MAX_1 = V1_MAX;
ENDIF;
IF (_HOUR == 2) THEN
V1_MIN_2 = V1_MIN;
V1_MAX_2 = V1_MAX;
ENDIF;
IF (_HOUR == 3) THEN
V1_MIN_3 = V1_MIN;
V1_MAX_3 = V1_MAX;
ENDIF;
IF (_HOUR == 4) THEN
V1_MIN_4 = V1_MIN;
V1_MAX_4 = V1_MAX;
ENDIF;
IF (_HOUR == 5) THEN
V1_MIN_5 = V1_MIN;
V1_MAX_5 = V1_MAX;
ENDIF;
IF (_HOUR == 6) THEN
V1_MIN_6 = V1_MIN;
V1_MAX_6 = V1_MAX;
ENDIF;
IF (_HOUR == 7) THEN
V1_MIN_7 = V1_MIN;
V1_MAX_7 = V1_MAX;
ENDIF;
IF (_HOUR == 8) THEN
V1_MIN_8 = V1_MIN;
V1_MAX_8 = V1_MAX;
ENDIF;
IF (_HOUR == 9) THEN
V1_MIN_9 = V1_MIN;
V1_MAX_9 = V1_MAX;
ENDIF;
IF (_HOUR == 10) THEN
V1_MIN_10 = V1_MIN;
V1_MAX_10 = V1_MAX;
ENDIF;
IF (_HOUR == 11) THEN
V1_MIN_11 = V1_MIN;
V1_MAX_11 = V1_MAX;
ENDIF;
IF (_HOUR == 12) THEN
V1_MIN_12 = V1_MIN;
V1_MAX_12 = V1_MAX;
ENDIF;
IF (_HOUR == 13) THEN
V1_MIN_13 = V1_MIN;
V1_MAX_13 = V1_MAX;
ENDIF;
IF (_HOUR == 14) THEN
V1_MIN_14 = V1_MIN;
V1_MAX_14 = V1_MAX;
ENDIF;
IF (_HOUR == 15) THEN
V1_MIN_15 = V1_MIN;
V1_MAX_15 = V1_MAX;
ENDIF;
IF (_HOUR == 16) THEN
V1_MIN_16 = V1_MIN;
V1_MAX_16 = V1_MAX;
ENDIF;
IF (_HOUR == 17) THEN
V1_MIN_17 = V1_MIN;
V1_MAX_17 = V1_MAX;
ENDIF;
IF (_HOUR == 18) THEN
V1_MIN_18 = V1_MIN;
V1_MAX_18 = V1_MAX;
ENDIF;
IF (_HOUR == 19) THEN
V1_MIN_19 = V1_MIN;
V1_MAX_19 = V1_MAX;
ENDIF;
IF (_HOUR == 20) THEN
V1_MIN_20 = V1_MIN;
V1_MAX_20 = V1_MAX;
ENDIF;
IF (_HOUR == 21) THEN
V1_MIN_21 = V1_MIN;
V1_MAX_21 = V1_MAX;
ENDIF;
IF (_HOUR == 22) THEN
V1_MIN_22 = V1_MIN;
V1_MAX_22 = V1_MAX;
ENDIF;
IF (_HOUR == 23) THEN
V1_MIN_23 = V1_MIN;
V1_MAX_23 = V1_MAX;
ENDIF;
Similarly write script on V2 and V3. After this write script on _Hour
tag as follows.
V1_MIN = V1;
V1_MAX = V1;
V2_MIN = V2;
V2_MAX = V2;
V3_MIN = V3;
V3_MAX = V3;
This will reset the parameters for calculating next hours minimum and
maximum.
Your report screen should look like as follows.

Here each 000 has been associated with a memory tag e.g.
V1 MIN column and 01:00 row has V1_MIN_1 and MAX column
has V1_MAX_1 and 24:00 row and V1 MIN column has V1_MIN_0
and MAX column has V1_MAX_0 associated with it. Like this
every 000 is associated with a memory tag with Show Value
animation. In Run Time all hourly minimum and maximum value
will be frizzed. To save this report at midnight i.e.0000hrs
write following script on _Date tag.
PRINTWINDOW "WINDOW_NAME",1,1,0,0,775,476;
SENDTOFILE 1,"FILE_NAME",1,1;
DESTROYREPORT 1;
To have unique file name use combination of Date, Month, Year and hour
for file name e.g.
Create STRING1 as memory tag of type string with initial value set to
path i.e. C:\ASTRA\REPORTS\
This Reports directory must exist in ASTRA.
Create FILE_NAME as memory tag of type string with initial value set
FILE_NAME.
Now write script on _Date tag as follows. This will have unique file
name on each date.
FILE_NAME=STRING1+STR(_DATE)+STR(_MONTH)+STR(_YEAR)+STR(_HOUR);
PRINTWINDOW "WINDOW_NAME",1,1,0,0,790,479;
SENDTOFILE 1,FILE_NAME,1,1;
DESTROYREPORT 1; |