Introduction Page 1 of 1 NETPORT Module Conitec NETPORT module sind intelligente Ein/Ausgabe-Module im Steckergehäuse mit Ethernetund USB- Anschluss. Sie sind einsetzbar als PC-I/O-Erweiterung oder für verteilte I/OAnwendungen im Netzwerk - wie z.B. Datenerfassung, Prozessüberwachung, Ansteuerung von Relais, Motoren, Servos oder Lampen. Alle NETPORT Module können eigenständig Skripte ausführen.
NETPORT 48OCA Page 1 of 3 Technische Daten NETPORT-48OCA Mini USB 2.0 und Ethernet 10/100 Anschluss Abmessungen ca. 64 x 42 x 18 mm DSUB-15 Stecker für Ein/Ausgänge 4 Open-Collector Ausgänge, max. 100 mA 2 Analog-Eingänge, 10 Bit, Referenzspannung 1.1 / 3.
NETPORT 48OCA Pin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Signal AGND GPIO11 / OC3 GPIO10 / OC2 GND GPIO9 / OC1 GPIO8 / OC0 GPIO0 / AD0 VCC GPIO1 / ADIO1 GPIO2 / ADIO2 GPIO3 / ADIO3 GPIO4 / ADIO4 GPIO5 / ADIO5 GPIO6 / ADIO6 GPIO7 / AD7 Page 2 of 3 Bemerkung Analog Ground Open Collector Ausgang Open Collector Ausgang Stromversorgung GND Open Collector Ausgang Open Collector Ausgang Analogeingang Stromversorgung VCC GPIO / Analogeingang GPIO / Analogeingang GPIO / Analogeingang GPIO / Analogeingang GPIO / Ana
NETPORT 48OCA Page 1 of 2 Technische Daten NETPORT-84OCO z z z z z z z z z Mini USB 2.0 und Ethernet 10/100 Anschluss Abmessungen ca. 64 x 42 x 18 mm DSUB-15 Stecker für Ein/Ausgänge 8 Open-Collector Ausgänge, max.
NETPORT 48OCA Page 2 of 2 (GND) des 15-poligen DSUB Steckers versorgt werden.
NETPORT 48OCA Page 1 of 1 NETPORT Web Interface Jedes NETPORT-Modul enthält einen HTTP-Server. Sobald das Modul mit dem LAN oder mit einem USB-Port verbunden wurde, lässt es sich über ein Webinterface konfigurieren, ähnlich wie ein Router. Sie erreichen das Modul, indem Sie dessen IP-Adresse in Ihren Browser eingeben (Werkseinstellung): http://192.168.1.12 Kurz darauf erscheint das Web-Interface des Moduls.
NETPORT Remote Control Page 1 of 11 NETPORT Fernsteuerung Jedes NETPORT Modul kann mit C-Skriptdateien oder Software-Programmen per TCP-Socket ferngesteuert werden. Alle I/O Funktionen lassen sich durch Skriptbefehle auslösen. Diese Skriptbefehle werden von einem Skript-Interpreter auf dem Modul ausgeführt. Rückgabewerte werden über den Socket-Kanal zurückgesendet. Die Skript-Syntax entspricht ANSI C mit einigen Unterschieden. Pointer werden nicht unterstützt, dafür jedoch einige C++ Elemente wie z.B.
NETPORT Remote Control Page 2 of 11 Die remote.dll library befindet sich im remote\API ordner, zusammen mit einem einfachen Testprogramm RemoteTest.cpp, das die Benutzung der Library demonstriert. Fernsteuerung per Linux Unter Linux können Befehle direkt zum Modul per Shell-Skript gesendet werden. Der Shell-Befehl connect 192.168.1.12 port 1233 öffnet den Socket auf der angegebenen IP-Adrresse; die folgenden Befehle werden dann direkt zum Socket gesendet.
NETPORT Remote Control Page 3 of 11 while(true) { io.IO1.set(true); pause(100); io.IO1.set(false); pause(200); } Configuring inputs and outputs (48OCA only) #include const int OUTPUT = GPIO(gpioCapDigitalOutput, gpioODTDirectLogicLevel); const int AIN = GPIO(gpioCapAnalogInput, gpioIDTDirectLogicLevel1); io.IO0.setFunction(AIN); // GPIO0 = analog input io.IO1.setFunction(OUTPUT); // GPIO1..GPIO6 = digital output io.IO2.setFunction(OUTPUT); io.IO3.setFunction(OUTPUT); io.IO4.
NETPORT Remote Control Type long, int short char bool Size 4 bytes 2 bytes 1 byte 4 bytes Range -2147483648 to 2147483647 0 to 65536 0 to 256 true, false float 4 bytes -3.4·1038 to 3.4·1038 double 8 bytes -1.8·10308 to 1.8·10308 Page 4 of 11 Precision 1 1 1 1 > 1.2·10-38 > 2.2·10-308 Integer constants in the program - such as character constants ('A'), integer numeric constants (12345) or hexadecimal constants (0xabcd) are treated as int. Constants containing a decimal point (123.
NETPORT Remote Control Page 5 of 11 Strings are a plain sequence of alphanumerical characters - letters, numbers or symbols - which are mostly used for messages, or for identifiers of objects such as projects (documents), actions, buffers, programmers (end devices), etc. They are defined this way: string name = "characters"; Defines a global string pointer with the given name and initializes it to the content characters between double quotation marks.
NETPORT Remote Control Page 6 of 11 An expression is an arithmetical operation that delivers a result, which can then be assigned to a variable. The arithmetic expression may be composed of any numbers, further variables, function calls, brackets, and arithmetic operators. The following operators are available in expressions: = Assigns the result right of the '=' to the variable left of the '='. +The usual mathematical operators. * and / have a higher priority than + and -.
NETPORT Remote Control Page 7 of 11 Functions, Variables, Comparisons ► latest version online Comparisons A comparison is a special type of expression that delivers either true (nonzero) or false (zero) as a result. There are special comparison operators for comparing variables or expressions: == != > >= < <= && || ! () True if the expressions left and right of the operator are equal. True if the expressions left and right of the operator are not equal.
NETPORT Remote Control Page 8 of 11 Speed: Fast Example: if (((x+3)<9) || (y==0)) // set z to 10 if x+3 is below 9, or if y is equal to 0 z = 10; else z = 5;// set z to 5 in all other cases See also: comparisons, while ► latest version online while (comparison) { instructions... } do { instructions... } while (comparison) ; Repeats all instructions between the winged brackets as long as the comparison between the round brackets is true resp. evaluates to non-zero.
NETPORT Remote Control Page 9 of 11 Example: float x = 3; for (int i=0; i<5; i++) // repeat 5 times x *= x; // calculate the 5th power of x See also: if, while, goto, break, continue, comparisons ► latest version online switch (expression) { case value: instructions... default: instructions... } The switch statement allows for branching on multiple values of a variable or expression. The expression is evaluated and compared with the case values.
NETPORT Remote Control Page 10 of 11 See also: while, for, break ► latest version online break The break statement terminates a loop or a switch..case statement, and continues with the first instruction after the closing bracket. Example: while (x < 100) { x+=1; if (x == 50) { break; } // loop will be ended prematurely } See also: while, for, switch, continue ► latest version online message(string) : string Returns a string with a placeholder replaced by a number.
NETPORT Remote Control Page 11 of 11 See also: message ► latest version online pause(int ms) Does nothing for the given number of millicesonds. Parameters: ms - milliseconds to wait. Example: pause(200); See also: message ► latest version online throw string Prints a string through the socket channel, and terminates the script. Parameters: string - string to print.
Variables Page 1 of 7 Variables and Arrays Variables store numbers. For defining a variable, use a C style declaration, like this: int name; // uninitialized variable int name = 123; // initialized variable This declaration creates a variable of type int with the given name. The name can contain up to 30 characters, and must begin with A..Z, a..z, or an underscore _.
Variables Page 2 of 7 See also: Strings, structs, functions Strings ► latest version online Strings are a plain sequence of alphanumerical characters - letters, numbers or symbols - which are mostly used for messages, or for identifiers of objects such as projects (documents), actions, buffers, programmers (end devices), etc.
Variables Page 3 of 7 arithmetic operators. The following operators are available in expressions: = Assigns the result right of the '=' to the variable left of the '='. +*/ The usual mathematical operators. * and / have a higher priority than + and -. % Modulo operator, the integer remainder of a division. | Bitwise OR, can be used to set certains bits in a variable. ^ Bitwise exclusive OR, can be used to toggle certain bits in a variable. ~ Bitwise invert, toggles all bits of a variable.
Variables Page 4 of 7 Comparisons A comparison is a special type of expression that delivers either true (nonzero) or false (zero) as a result. There are special comparison operators for comparing variables or expressions: == True if the expressions left and right of the operator are equal. != True if the expressions left and right of the operator are not equal. > True if the expression left of the operator is greater than the expression right of the operator.
Variables Page 5 of 7 comparisons, while while (comparison) { instructions... } ► latest version online do { instructions... } while (comparison) ; Repeats all instructions between the winged brackets as long as the comparison between the round brackets is true resp. evaluates to non-zero. This repetition of instructions is called a loop. The while statement evaluates the comparison at the begin, the do..while statement at the end of each repetition.
Variables Page 6 of 7 switch (choice) { case 0: print("Zero! "); break; case 1: print("One! "); break; case 2: print("Two! "); break; default: print("None of them! "); } See also: if, while, goto, break, continue, comparisons ► latest version online continue Jumps to the begin of a while loop or the continuation part of a for loop.
Variables Page 7 of 7 print(message("The document ID is: \"%name%\".") << sDocument); See also: print, throw print(string) ► latest version online Prints a string through the socket channel. Parameters: string - string to print. Example: print("Test!"); See also: message pause(int ms) ► latest version online Does nothing for the given number of millicesonds. Parameters: ms - milliseconds to wait.