reading the PC name in an InTouch script

W
Use the function
GetNodeName( x, n )
where
x = String Tagname in which the node name will b e stored.
n = integer number or variable giving the maximum number of characters stored in "x"
 
L

Lewis Bodden

GetNodeName( NodeName, 131 );

Where NodeName is a Memory Message type Tag. Be sure to allow for the maximum length of the computer name in the Tag Length and the length parameter in the GetNodeName function.

WindowMaker help has an example that I modified:

GetNodeName("MyNodeTag",131);

If MyNodeTag == "Master" THEN

MessageTag = "This is the Primary Machine!";

IOSetAccessName( "MasterPLC", " ", "", "" );

ELSE

MessageTag = "This is a Secondary Machine!";

IOSetAccessName( "MasterPLC", "Master", "", "" );

ENDIF;

The IOSetAccessName function is a useful addition to direct the Access Name to different Nodes, Applications or Topics. If you need more information on this let me know.

If you are not running NetDDE or do not wish to, there are other methods using API Calls. If you need more information on this let me know.

[email protected]
 
A

Anthony Kerstens

>From INTOUCHREF.PDF
~~~~~~~~~~~~~~~~~~~
GetNodeName() system
Returns the NetDDE node name to a string variable.

Syntax GetNodeName( Tagname, NodeNum);
~~~~~~~~~~~~~~~~~~~
Parameter Description
Tagname InTouch message type tagname that will hold the node name.
NodeNum Integer that specifies the character length for the message tagname.
~~~~~~~~~~~~~~~~~~~
Remarks
When this QuickScript executes, the GetNodeName() function will read the
local node name and return it to Tagname. (NodeNum sets the character length
for the message tagname.)
~~~~~~~~~~~~~~~~~~~
Note
This function only works if NetDDE is running in Windows 95 (or later) or if
Network DDE is running in Windows NT 4.0 SP4 (or later).
~~~~~~~~~~~~~~~~~~~
Example(s) GetNodeName("MyNodeTag",131);
If MyNodeTag == “Master” THEN
MessageTag = “This is the Primary Machine!”;
ENDIF;
~~~~~~~~~~~~~~~~~~~

Anthony.
 
hello,

i have a problem. the INTOUCH 8 and DASSIDIRECT 1.0.100 cannot make a connection to a remote computer DASSIDIRECT, using the IOsetaccessname function. why?

thank you.
 
Top