Cara membaca register Real / Float di Machine SCADA Expert (MSE) / Indusoft Web Studio (IWS)

bingung cara membaca register modbus dengan IWS atau Machine SCADA Expert (MSE) ?

pastikan, baca manual help nya MOTCP.PDF di folder installer Machine SCADA Expert (MSE), disana terdapat cara komunikasinya dan data type nya, serta format penulisan registernya.

READ MORE

Magelis EdgeBox (Node-Red) to S7 PLC (baca PLC S7-1500)

Berikut adalah langkah langkah yang dilakukan untuk komunikasi ke PLC S7, bisa di implement ke S7-1500 / S7-1200 tanpa harus menggunakan gateway lagi atau merubah/modifikasi di sisi setting PLC.

metode ini juga bisa digunakan untuk menjadikan Magelis Edge Box menjadi gateway dari S7 TCP ke Modbus TCP.

READ MORE

Baca INT 64 bit di SCADA?

seperti kita ketahui, kebanyakan SCADA belum support tipe data Integer 64 bit (max value: 9,223,372,036,854,775,807), lalu gimana kalau kita mau baca dari device yang menyediakan data ini? contohnya pada power meter Schneider untuk data KWH

berikut trik nya:

  1. Siapkan 1 variable Real / floating 32bit – sebagai contoh kita kasih nama Energy)
  2. Siapkan 4 variable INT (16bit) dimana nilai tersebut  didapat dari register modbus PM yaitu 43204, 43205, 43206, 43207) – sebagai contoh kita kasih nama RAW_1 dan RAW_2, RAW_3, dan RAW_4

Energy = (raw_4 * 281474976710656) + (raw_3 * 4294967296) + (raw_2 *  65536) + raw_1

Cara koneksi ke PLC Panasonic dari Citect SCADA

Jadi, awalnya ini pertama saya ketemu sama PLC murmer yang tidak terlalu common, dan saya juga tertarik untuk coba komunikasi ngambil data dari PLC ini. di sisi PLC cukup di setting di Basic Communication Information dan kemudian bisa assign IP address disini. yang kedua di User Connection information setting 1…16 yang artinya ada 16 jenis koneksi yang bisa dilakukan ke PLC ini dengan port dan setting yang berbeda. kita cukup atur satu saja.

pertama kita set dulu IP nya di Basic Communication Information seperti gambar berikut:

Kemudian masuk ke setting User connection information setting 1 dan setting seperti ini atau sesuai kebutuhan. terutama di PORT dan communication Type yaitu menggunakan UDP atau TCP. (kita set menggunakan UDP)

Kemudian……..

READ MORE

Node-Red ~ Modbus Floating Point Convert (Float32 / Real)

this function script is used to convert your 2 words into Float32bit

/* Converts from an number, string, buffer or array representing an IEEE-754 value
 to a javascript float.
 The following may be given in msg.payload:
 A string representing a number, which may be hex or binary
 examples, "1735" "0x02045789" 0b01000000010010010000111111011011
 An integer value
 A two element array or buffer of 16 bit values, less significant byte first.
 A four element array or buffer of 8 bit values, most significant byte first.
 Source: https://flows.nodered.org/flow/359ead34237b7ab6ec0465ee85a34b62
 */
 // first make a number from the given payload if necessary
 let intValue;
 if (typeof msg.payload === "number") 
{
 intValue = msg.payload;
 } else if (typeof msg.payload === "string") {
 intValue = Number(msg.payload);
 } else if (msg.payload.length == 2) {
 // two int array or buffer
 intValue = (msg.payload[1] << 16) + msg.payload[0];
 } else if (msg.payload.length == 4) {
 // four byte array or buffer
 intValue = (((((msg.payload[0] << 8) + msg.payload[1]) << 8) + msg.payload[2]) <<
 8) + msg.payload[3];
 } else {
 node.warn("Unrecognised payload type or length");
 } 
 msg.payload = Int2Float32(intValue);
 msg.payload = msg.payload.toFixed(1);
 return msg;
 function Int2Float32(bytes) {
 var sign = (bytes & 0x80000000) ? -1 : 1;
 var exponent = ((bytes >> 23) & 0xFF) - 127;
 var significand = (bytes & ~(-1 << 23));
 if (exponent == 128)
 return sign * ((significand) ? Number.NaN : Number.POSITIVE_INFINITY);
 if (exponent == -127) {
 if (significand === 0) return sign * 0.0;
 exponent = -126;
 significand /= (1 << 22);
 } else significand = (significand | (1 << 23)) / (1 << 23);
 return sign * significand * Math.pow(2, exponent);
 }

Modbus-IoT (Modbus over MQTT)

Modbus?? old school protocol (more than 40th years).

when Modbus created, it was created for Serial communication via RS485. after year by year, technology was changing and ethernet / TCP widely used in PLC and industrial control system, then Modbus move their medium to Ethernet and wrap their message in TCP (encapsulated) over ethernet.

Now, when everything going to the cloud or  RTU/PLC are not in the same place with SCADA and it only have internet connection, it will be hard and expensive for Modbus to keep exist in Internet area. because we need at least public IP for each device, or creating VPN.

but with MQTT the message can be send over the broker (on the cloud), so it will be exiting if modbus can be sent through MQTT.

if you’ve heard about Node-red this is cool IoT tools/platform built in NodeJS.

I’m using Node-red to make it’s encapsulation, and Modscan as Modbus Master (or SCADA), and Modsim as Modbus Slave (or  PLC)

READ MORE

CitectSCADA – Dot Matrix Alarm Printing (Problem)

If you are having trouble with alarm printing to dot matrix (via DOS-PRINT)

Suspect trouble: Your alarm only printed once, after that you can’t print anymore even using manual command/script.

here is some trick to make your alarm print works:

1st Step:

configure your device (printer) as usual configuration (I assume you have configured DOS-PRINT)

2ND Step:

This is the main trick, we need to Flush the printer (In my case, I put every 3 second)

and the function PrinterFlush() should be created in cicode.

And here is the cicode function:

FUNCTION PrinterFlush()
INT hDevice;
	ErrSet(1);
	hDevice = DevOpen("PRINT1",0);
	IF IsError() = 0 THEN
		DevFlush(hDevice);
		DevClose(hDevice);
	END
	ErrSet(0);
END

 

Done.

I hope these steps work for you, I worked really hard on this! Sometimes while working in front of the computer I worry I sit around too much. There is a lot of info online on the negative effects of doing so. I try to take care of myself by exercising when I can and watching what I eat, also whenever possible, but I sometimes wonder if it’s enough. I even take a health supplement to ensure I’m giving my body what it needs. I highly recommend it by the way. You can find it at http://kratommasters.com if you want to check it out.

Citect SCADA / Vijeo Citect to SQL With CiCode

Jika anda membutuhkan sebuah data logger dari Citect SCADA / vijeo citect ke SQL misal Ms SQL Server, atau anda ingin melalukan sejumlah sampling data dari Citect SCADA / Vijeo Citect ke database, berikut video solusinya:

 

Cara logging data Citect SCADA ke SQL, Citect to SQL