Hello, right now, i'm on same project, read data from a COM port - RS232, but still not working.
i used php_serial.class.php
(i get from php-serial-master
) did not get any data from hyper terminal
i try to this code (forgot where i get it from internet) below too, but it still not working at all, would you mind to share the code that you use? FYI, data that we want to get is from scaling devices which has a modification cable that cross between cable number 3 and 5 if i'm not mistaken
<?php
$cmd_str = "MODE COM3: BAUD=9600 PARITY=N DATA=8 STOP=1 XON=OFF TO=OFF OCTS=OFF ODSR=OFF IDSR=OFF RTS=OFF DTR=OFF";
$output = array();
exec($cmd_str, $output, $result);
set_time_limit(0);
$serial_port = fopen("COM3","rn");
$hasil = fgets($serial_port,9600);
fflush($serial_port);
fclose($serial_port);
print("<pre>");
print_r($cmd_str);
print("\n");
print_r($output);
print("\n");
print_r($hasil);
print("\n");
print("</pre>");
exit;
$serial_port = fopen("COM4","wb");
$a = chr(1);
$hasil = fwrite($serial_port,$a);
fclose($serial_port);