Presentation is loading. Please wait.

Presentation is loading. Please wait.

NPort Advanced Functions - Driver

Similar presentations


Presentation on theme: "NPort Advanced Functions - Driver"— Presentation transcript:

1 NPort Advanced Functions - Driver
Moxa Connectivity

2 Advanced Functions – Overview
Firmware Driver Inactivity Timeout Delimiter Force Transmit Packet Length Connection Control TCP Alive Check Timeout Max. Connection Ignore Jammed IP Allow Driver Control Command by Command Authentication Fast Flush TX Mode Auto Network Re-connection Return Error If Network Is Unavailable Always Accept Open Requests COM Grouping (NPort 5000) Secure Basically, we can divide all the NPort Advanced Functions to two groups: one is configured with Driver which means only available with RealCOM mode and the other one is configured with Firmware. There is a particular function Secure needs to be enable at Firmware & Driver, if you only enable it with one side, it will not work. For the Advanced Functions of Firmware, we can separate them into two groups. The left-hand side functions are for the Serial behaviors of NPort and the right-hand side functions are for the Ethernet behaviors. Serial Ethernet 2

3 Advanced Functions – Driver
OP Mode Driver Function RealCOM NPort Administration Suite NPort Windows Driver Manager Fast Flush TX Mode Auto Network Re-connection Return Error If Network Is Unavailable Always Accept Open Requests COM Grouping This slide show the Advanced Functions that are built in at the Windows Driver which means these functions only support RealCOM mode. 3

4 Fast Flush Serial Ethernet
The following advanced functions are configured at the Windows Driver, so they are only supported by RealCOM mode. Fast Flush is a function to decide when NPort’s driver will report clear buffer OK to the application. Serial Ethernet 4

5 Fast Flush – Introduction
Q : What is Fast Flush? When do I need to enable this function? Where can this function be used? Tips: When your program uses the PurgeComm function call, Fast Flush will avoid forcing the driver to query NPort firmware continuously when in Real Com mode When you want to understand this function, I try to provide you 3 questions 5 5

6 Fast Flush – Introduction
What is PurgeComm? Before working with a port, we recommend clearing the buffers; sometimes there's also a need to clear the buffers when working with ports. The PurgeComm function can be used for this purpose. This function can also stop the read and write operations What is Fast Flush? Fast Flush is effective with PurgeComm function to directly flush the local buffer rather than querying NPort firmware continuously. If you don’t use this function, it would take more time (about several hundred milliseconds) compared to native COM ports, especially when network traffic is very heavy. If we wish to understand Fast Flush, we have to know what is PurgeComm? Maybe you would think that you don’t care about the timing, but if lots of PurgeComm functions in your program, it would be influenced on your program transmitting or receiving.

7 Fast Flush – PurgeComm Introduction
You must make sure that your application program uses Win32 PurgeComm functions (IOCTL_SERIAL_PURGE) for NPort Serial-to-Ethernet communication. You can use capture logs from the *Port Monitor utility to determine if PurgeComm functions exist. This function works when there are PurgeComm in your program. Besides, this issue is just happened on S2E application only, it is due that networking application is different from the native com application. If PureComm in native Com ports, it would not have much effort to flush; but if S2E, it would take more time. If I were you, I will use Port Monitor to capture program logs to analysis its actions. It can be easy to get the function call whether exist on my program or not! This utility is freeware to use, and every time, Moxa Technical Engineers will also recommend users to use this utility. This figure is I captured from port monitor. As you see, this PurgeComm is easy to know in this program!! A portmon (Port Monitor) is a 3rd party freeware utility and GUI/device driver combination that monitors and displays all serial port activity on a system.

8 Fast Flush – How does It Work?
If Fast Flush is DISABLED……. It takes about >100 ms for PurgeComm AP < 10 ms 1. PurgeComm( ) Driver 2. Flush driver buffer But if Fast Flush is ENABLED……. It takes less than <10 ms for PurgeComm AP Driver Fast Flush Enable Firmware PurgeComm Flush driver buffer Flush firmware buffer <10 ms > 100 ms Disable 4. Return “success” >100 ms This animation will show you what the difference between ENABLE Fast Flush and DISABLE Fast Flush Function! If Flash Flush is DISABLE……………….. When AP use PurgeComm, it will flush drive buffer and takes lee than 10ms. However it will query NPort’s Firmware to make sure the firmware buffer has been flush. NPort’s firmware will return “ Success” until its buffer is empty. It takes about hundreds ms for purgeComm 2) But if Flash Flush is ENABLE…………… It will directly flush driver buffer without querying NPort’s Firmware. It just takes about less than 10 ms for PurgeComm From the page, you can understand that if enabling Fast Flush, it will reduce the processing time Firmware 3. Flush firmware buffer 8

9 Fast Flush – Where to Find It?
Apply Change to activate this optional setting Apply Change to activate this optional setting NPort 5000 These 2 screenshots from NPort driver: The left one is from NPort Administrator Suite, which is available for 2G NPort such as NPort 5000 series and the right one is from NPort Windows Driver Manager, which is available for 3G NPort such as NPort 6000 series. As you see, all NPort windows driver can provide Fast Flush. Most important of all , when you select the checkbox, please apply change the configuration in driver NPort 6000 9

10 TX Mode Serial Ethernet
When the software sends out the data, how will the driver handles it? There are two ways about the driver’s behavior. Serial Ethernet 10

11 TX Mode – Introduction Q : What is Hi-Performance and Classical in TX Mode? Where can this function be used? Tips: TX mode in RealCom Mode is available for better data performance and reliability There are two modes of how the driver sends data: Hi-Performance and Classical. 11 11

12 TX Mode – What is It? Transmission Hi-Performance Classical
NPort Driver Handling NPort driver will notify the AP (application program) to return when the data that has been sent out from the driver. NPort driver will NOT notify AP until the data has been sent out from NPort’s firmware to the UART Selection Principle application just needs to send or receive data to/from your device send-and-wait: send one polling command and wait for the answer Suitable Application require better performance or throughput require critical response time Advantage works more quickly works more reliably The difference in behavior is: Hi-Performance NPort driver will notify AP (application program) to return when the data that has been sent out from the driver. It works more quickly. Classical NPort driver will not notify AP until the data has been sent out from NPort’s firmware to the UART. It works more reliably. The selection principle is, Hi-Performance If your application just needs to send or receive data to/from your device, you can use this mode by default to get better performance. Classical If your application belongs to send-and-wait, meaning send one polling command and then wait for the answer, the response time may be very critical. For this reason, you should use this mode. 12 12

13 TX Mode – Where to Find It?
NPort 6000 NPort 5000 They are hidden from Port Properties You can use Hi-performance mode by default to get better performance. Or use Classical mode for time-critical application. 13

14 Auto Network Re-connection
When the connection is disconnected, the NPort’s driver will try to re-establish the connection with NPort automatically if the user enables Auto Network Re-connection function. Auto Network Re-connection is a function which NPort’s driver will try to re-establish the connection with NPort automatically if the connection is disconnected. Serial Ethernet 14

15 Auto Network Re-connection – Introduction
Q : What is Auto Network Re-connection? Where can this function be used? Tips: When NPort does not respond to background “check alive” packets, the driver will repeatedly attempt to re- establish the TCP connection. The customer’s software doesn’t have to close the port then re-open it. If you want to reduce the network loading, you may disable this function. 15 15

16 Auto Network Re-connection – How does It Work?
2. Crash or network is broken 1. Establish Connection Host 3. Check Alive 4. No Response 5. Try to Re-connect Because the driver will try to re-establish the connection automatically, you can disable it to reduce the network loading. Ethernet RealCOM mode 16 16

17 Auto Network Re-connection – Where to Find It?
17 17

18 Return Error If Network Is Unavailable
Return Error If network Is Unavailable is a function when the network is unavailable, the NPort’s driver will report error to the application. Serial Ethernet

19 Return Error If Network Is Unavailable – Introduction
Q : What is Return Error If Network Is Unavailable? Tips: If the driver cannot establish the connection to NPort, calling the Win32 Comm function will result in the error return code “STATUS_NETWORK_UNREACHABLE” 19 19

20 Return Error If Network Is Unavailable – How does It Work?
AP 2. Crash or network is broken 1. Establish Connection 5. Return STATUS_NETWORK_UNREACHABLE 5. 3. Call Win32 Comm 3. Host 4. No Response Driver Ethernet RealCOM mode 20 20

21 Return Error If Network Is Unavailable – How does It Work?
When the driver cannot establish the connection to NPort, it will return 0xC000023C which means the network is unreachable. 21 21

22 Return Error If Network Is Unavailable – Where to Find it?
22 22

23 Always Accept Open Requests
Return Error If network Is Unavailable is a function when the network is unavailable, the NPort’s driver will report error to the application. Serial Ethernet

24 Always Accept Open Requests – Introduction
Q : What is Always Accept Open Requests? Where can this function be used? Tips: Even the driver cannot establish the connection to NPort, user's software still can open the mapped COM port just like a onboard COM port. 24 24

25 Always Accept Open Requests – How does It Work?
AP 1. Crash or network is broken 3. Open COM port OK. 3. 2. Host 4. Try Establish Connection Driver Ethernet RealCOM mode 25 25

26 Always Accept Open Requests – Where to Find it?
26 26

27 Always Accept Open Requests – Advanced Options
Put writing data in queue if network connection lost Opened the COM port when NPort is offline Start writing data to COM port Stored the data Send data to NPort while connects to it Drop writing data if network connection lost Dropped the data 27 27

28 Supported Models: NPort 5000 / 5000A Series
COM Grouping Supported Models: NPort 5000 / 5000A Series NPort IA5000 / IA5000A Series Return Error If network Is Unavailable is a function when the network is unavailable, the NPort’s driver will report error to the application. Serial Ethernet

29 COM Grouping – Introduction
Q : What is COM Grouping? Where can this function be used? Tips: Designed to simulate the serial RS-485 multi-drop behavior over an Ethernet network. 29 29

30 COM Grouping – How does It Work?
Ethernet COM 4 I use a display application example to introduce the COM grouping function. The host PC uses MOXA driver and map all serial port of NPort to COM 4. When PC uses COM 4 to send the data, all of the port in this COM group will receive the data. All the display will show the same data at the same time. In COM grouping function, you can group all NPort in a COM Group or you can separate a NPort to different COM Group. Confidential

31 How to Configure COM Grouping?
Creating a COM Group Adding a Port to a COM Group Removing a Port from a COM Group Deleting a COM Group Modify Ports in a COM Group Driver Support List: How to configure COM Grouping? In the below slides, I will introduce 5 major operators. 1. Creating a COM Group 2. Adding a Port to a COM Group 3. Removing a Port from a COM Group 4. Deleting a COM Group 5. Modify Ports in a COM Group After the training slides, I think you will be the major of the COM grouping. If you want to use COM Grouping, please use NPort Administration Suite V1.14 later driver. We only support the function in Windows NT and Windows 2000 later and maximum 32 ports of each COM Group. If the customer needs over 32 ports of each COM Group, we can follow MOXA CV process to support the function. Version NPort Administration Suite V1.14 later OS Windows NT and Windows 2000 later Max. ports 32 of each COM Group Confidential

32 Creating a COM Group (Step 1-3) Step1: Select group members
2 Follow the steps below to add multiple COM ports into one group. Step1: Select serial port for the group that you are going to create, and right-click to select COM Settings. Confidential

33 Step2: Group selected ports together
3 4 Step2: Select a COM number for this COM group. You may select one of the ports already assigned to a member of the COM Group. However, once the COM Group is configured, all of the original COM number within the group will be released simultaneously. Select the “Grouping selected port(s) together” checkbox then click “OK” button. 5 Confidential

34 Step3: Apply changes 6 Confidential
Step4: Click “Apply” button to apply the change, then COM 8(Group) settings is completed. Confidential

35 Adding a Port to a COM Group (Step 1-4) Step1: Select member
Follow the steps below to add a serial port into an existing COM Group: Step1: Select the serial port that you are adding and right-click to select COM Settings. 2 Confidential

36 Step2: Grouping 3 4 5 Confidential
Step2: Select the COM number of the COM Group you are adding and check mark the “Grouping selected port(s) together” check box and then click OK. Confidential

37 Step3: Confirming 6 Confidential
Step3: Click “Yes” to make the port in the COM 8 Grouping. Confidential

38 Step4: Apply changes 7 Confidential
Step4: Click “Apply” button to apply the change, then port 2 of NPort 5210A adds in COM 8(Group) settings. Confidential

39 Removing a Port from a COM Group (Step 1-3) Step1: Select port
Follow the steps below to remove a serial port from a COM Group Step1: Select ports which you want to remove from the COM Group and right-click to select “COM Settings”. 2 Confidential

40 Step2: Change to a unused COM number
3 Step2: Select a unused COM number then click “OK”. 4 Confidential

41 Step3: Apply changes 5 Confidential
Step3: Click “Apply” button to apply the change, then port 2 of NPort 5210A be removed from COM 8 (Group) settings. Confidential

42 Deleting a COM Group (Step 1-3) Step1: Select COM Group
Follow the steps below to delete a COM Group and then auto-assign COM numbers for each port in the Group: Step1: Select all of COM8 (Group) ports and right-click to select “COM Settings”. 2 Confidential

43 Step2: Change COM number
3 4 5 Step2: Select a not used COM number and Select the “Auto enumerating COM number for selected ports” check box then click “OK”. Confidential

44 Step3: Apply changes 6 Confidential
Step3: Click “Apply” button to apply the change, then COM Group 8 has been removed. Confidential

45 Modify Ports in a COM Group
Changing the COM Number of a COM Group Changing Read/Write/Signal Status Permission Changing Advanced Settings of the COM Group In the following subsections we examine three ways in which the serial ports in a COM Group can be modified.

46 Modify Ports in a COM Group- Changing the COM Number of a COM Group Step1: Select target COM Group
Follow the steps below to change the COM Number of a COM Group Step1: Select all serial ports in the Group and right-click to select COM Settings. 2 Confidential

47 Step2: Select target COM number
3 4 Step2: Select a COM number that is not in use or assigned to a Group. 5 Confidential

48 Step3: Apply changes 6 Confidential
Step3: Click Apply to apply the settings. You will be able to view the serial ports that were assigned to and removed from the Group. Confidential

49 Modify Ports in a COM Group- Change Read/Write/Signal Status Permission Step1: Select any COM port of target COM Group 1 Follow the steps below to change the permission of read/write/signal status of a COM Group Step1: Select a serial port in the Group and then right-click and select COM Settings. 2 Confidential

50 Step2: Enable the COM Group settings page
3 4 5 Step2: Select the Grouping selected port(s) together check box. It will enable the COM grouping settings page. Confidential

51 Step3: Change the settings
Read Write 6 Read Read Write Step3: On the “COM Grouping” page, you can specify one serial port whose signals will be taken into account by the COM Group and change the Read/Write status for each serial port. The signal status port is unique in a COM group. If you enable the Read function, it means NPort accepts the data from serial to Ethernet. If you enable the Write function, it means NPort accepts the data from Ethernet to serial. 7 ※ Only one “Signal Status” in a group Confidential

52 Step4: Apply changes 8 Confidential
Step4: Click Apply to apply the settings. Confidential

53 Change Advanced Settings Step1: Select “Signal Status” port of target COM Group
Follow the steps below to change advanced settings of a COM Group Step1: Select the ”Signal Status” controlled port and then right-click and select COM Settings. 2 Confidential

54 Step2: Change Advanced Settings
Select “Signal Status” port Non select “Signal Status” port 3 4 Step2: The Advanced Settings pages will be enabling for modification. Therefore, if you didn’t select the correct “Signal Status” port, the Advanced Settings pages will like the right picture. You can select the “COM Grouping” page to find the correct “Signal Status” port. (Click next) Like the example, the port 1 of the “ ” is the “Signal Status” port. 5 Confidential

55 Step3: Apply changes 6 Confidential
Step3: Click Apply to apply the settings. Confidential

56 Hint: How to find the “Signal Status” of target COM Grouping?
COM Settings -> COM Grouping Page How to find the “Signal Status” of target COM Grouping? If you don’t know which one is signal status port, you can select any port of the COM group and see the com group page of the com settings. You will find out the signal status settings of the COM Group. Remember the IP address of the signal status port and the port number. You can reselect the signal status port to change advanced settings. Ex: Port 1 is the “Signal Status” port of the COM Group

57 Secure Serial Ethernet
Secure is a function which needs NPort’s firmware and driver to enable at the same time to encrypt the TCP connection. Serial Ethernet 57

58 Secure Operation modes (SSL)
Secure Real COM mode Must enable encryption in both Windows driver and NPort 6000 firmware Secure TCP Server mode Programming by OpenSSL A SSDK (Secure SDK) TCP Client example provided for testing of Secure TCP Server mode Secure TCP Client mode Example for TCP Server will be provided in next SSDK As I have introduced, there are three popular operation modes are implement as SSL. For Secure Real COM mode, if you just enable the security within Windows driver and NPort’s firmware. They will communicate securely by SSL. Of course, all serial data will be encrypted. For Secure TCP Server mode, if you can use your original socket program and included some OpenSSL files, and it will be able to communicate NP6000 with security. Future more, MOXA also provides a Secure SDK (SSDK), and build-in a TCP software for testing TCP Server mode. For Secure TCP Client mode, you also could develop your own software by OpenSSL, and MOXA also will provide a TCP Server example for SSDK.

59 RealCOM mode 12345 abcde No Encryption 59
It is a normal case for NPort 5000 series or NPort 6000 series without security in Real COM mode. In this case, it is obvious all serial data are captured and sniffed by any networking analysis software such as Ethereal. 59

60 Secure RealCOM mode @#$^* &G%^ Encryption Encryption 60
When I enable the security function between driver and NPort 6000. In this case, it is obvious all serial data are encrypted and no one can captured and sniffing by any networking analysis software. Regarding how do they work, I will explain more detain in next slide. 60

61 Secure RealCOM mode – SSL Handshake Flow
Hello Client: Cipher Suite AES, DES, RC4… Hello Server: AES Certificate: Server Key Exchange Public Server Done Client Key Exchange Public Change Cipher Spec Finish Change Cipher Spec Finish

62 Secure TCP Server mode TCP Client Software TCP Server Mode
SSDK TCP Client Secure Socket Compared to Secure Real Com mode, you have to enable the OpenSSL functions within your source code by SSDK. So, there are two kinds of methods for programmers to use NPort6000. TCP Client Using MOXA SSDK example, which has provided some function calls to communicate with NPort6000 Included OpenSSL within your socket programming, and you also can communicate with NPort6000 TCP Server It is very easy like Real COM mode that enable Secure option, then save and restart SSL 62

63 Secure TCP Client mode TCP Server Software SSDK TCP Server
Secure Socket TCP Client Mode It is the same concept for NPort TCP Server mode TCP Client The security activated after enable Secure option, then save and restart TCP Server Using MOXA SSDK TCP Server example in the future, which has provided some function calls to communicate with NPort6000 Included OpenSSL within your socket programming, and you also can communicate with NPort6000 SSL 63

64 Secure : Keep Connection
Q : What is Keep Connection? When do I need to enable this function? Tips: If the customer’s application will open/close COM ports frequently and the NPort 6000 is only for one host, the customer can enable this option to speed up the opening/closing time. 64 64

65 Secure : Keep Connection – How does It Work?
If this function is disabled: 400 ms 1. Open COM Port Open Data port 950 Cmd port 966 60 ms 2. Close COM Port Close Data port 950 Cmd port 966 Secure RealCOM mode 400 ms 3. Open COM Port Host 60 ms 4. Close COM Port Ethernet 65 65

66 Secure : Keep Connection – How does It Work?
If this function is disabled: 66 66

67 Secure : Keep Connection – How does It Work?
If this function is disabled: 361ms 67 67

68 Secure : Keep Connection – How does It Work?
If this function is enabled: 400 ms 1. Open COM Port Open Data port 950 Cmd port 966 60 ms 2. Close COM Port Close Cmd port 966 Secure RealCOM mode 40 ms 3. Open COM Port Host 60 ms 4. Close COM Port Ethernet 68 68

69 Secure : Keep Connection – How does It Work?
If this function is enabled: 69 69

70 Secure : Keep Connection – How does It Work?
If this function is enabled: 3.1ms 70 70

71 Secure : Keep Connection – Where to Find It?
71 71


Download ppt "NPort Advanced Functions - Driver"

Similar presentations


Ads by Google