Search found 44 matches
- Mon Mar 26, 2012 7:45 pm
- Forum: Scripting
- Topic: Serial Communication
- Replies: 17
- Views: 24171
Re: Serial Communication
Dear Mark, I'm so sorry for my stupidity. You were right: the Tag, which is used to display Baudrate, must be declare as INT32 cause faster baudrate (such as 38400, 115200) is larger than 32,767. But, I don't know why I couldn't communicate 2 devices using baudrate faster than 19200, eventhough my s...
- Fri Mar 23, 2012 5:00 am
- Forum: Scripting
- Topic: Serial Communication
- Replies: 17
- Views: 24171
Re: Serial Communication
At last, I can communicate with serial device smoothly without any errors. Every 500ms, HMI would send a packet (10bytes + CRLF) to serial device, and a packet contains command which tell serial device to send back the data. That's it! I think the trouble is there's no handshake between serial devic...
- Thu Mar 22, 2012 9:55 am
- Forum: Scripting
- Topic: Serial Communication
- Replies: 17
- Views: 24171
Re: Serial Communication
My HMI would send commands (up to 10 bytes - small packet!) to device and receive data (up to 10 bytes). But, in this test, my serial port just try to read data from serial device to HMI. I think it should be handle every 500ms... But it takes about 3-4 ticks, which means 1.5s-2s, I don't think this...
- Thu Mar 22, 2012 5:19 am
- Forum: Scripting
- Topic: Serial Communication
- Replies: 17
- Views: 24171
Re: Serial Communication
I did try reading buffer as your advice: private static void SerialPortScan(Object sender, EventArgs e) { _serialTimer.Enabled = false; //Read data from RXD buffer to _bufferReceive _bufferReceiveLength = _serialPort.BytesToRead; if (_bufferReceiveLength > 0) { if (_bufferReceiveLength < _serialPort...
- Wed Mar 21, 2012 8:00 pm
- Forum: Scripting
- Topic: Serial Communication
- Replies: 17
- Views: 24171
Re: Serial Communication
Hi Ron and Mark, Thanks for your replies, I was so silly not to check whether Bytes To Read greater than 0 or not. If Bytes To Read = 0, Read methods would stand by and wait until there're some bytes in buffer... ReadExisting() would be great if my system communication using ASCII data format. Howev...
- Wed Mar 21, 2012 10:22 am
- Forum: Scripting
- Topic: Serial Communication
- Replies: 17
- Views: 24171
Re: Serial Communication
hi Mark, Thanks for your reply. I'm using a timer to read buffer of serial port, and using timer Tags to indicate timer interval each Timer event: private static void TimerProcessHandler(Object sender, EventArgs e) { timer.Enabled = false; if (Globals.Tags.timer.Value++ == 255) Globals.Tags.timer.Va...
- Wed Mar 21, 2012 4:00 am
- Forum: Scripting
- Topic: Serial Communication
- Replies: 17
- Views: 24171
Re: Serial Communication
Dear Ron, Thanks to your Serial Communication script, which was post in FAQs, I finally communicate HMI with another device using COM port. Sending bytes from HMI works flawless, but I encounter some problems when try to read data in serial buffer. I try using Read(byte[] byte, int index, int count)...
- Thu Mar 08, 2012 3:28 am
- Forum: Scripting
- Topic: Security group
- Replies: 8
- Views: 16594
Re: Security group
I guess I found another way to get Security Group: using Neo.ApplicationFramework.Tools.Security; and then call class SecurityGroup public SecurityGroup _securityGroup; Dear Ron, I was so silly, SecurityGroup and SecurityUser is just a class, I need to call an instance, which has the Group and User...
- Wed Mar 07, 2012 7:47 pm
- Forum: Scripting
- Topic: Security group
- Replies: 8
- Views: 16594
Re: Security group
Dear Ron, Moreover, this is what made me confused: IList<ISecurityUser> HMIUsers = Globals.Security.Users; int userIndex = GetUserIndex(HMIUsers, userName); IList<ISecurityGroup> userGroups = HMIUsers[userIndex].SecurityGroups ; Actually, this security group pop up in my head in the first time, so ...
- Tue Mar 06, 2012 11:00 am
- Forum: Scripting
- Topic: Security group
- Replies: 8
- Views: 16594
Re: Security group
Dear Ron, Moreover, this is what made me confused: IList<ISecurityUser> HMIUsers = Globals.Security.Users; int userIndex = GetUserIndex(HMIUsers, userName); IList<ISecurityGroup> userGroups = HMIUsers[userIndex].SecurityGroups ; Actually, this security group pop up in my head in the first time, so I...