ICP DAS USA VPD-130-H User manual

Type
User manual

This manual is also suitable for

HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 1
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
HMIWorks
API Reference
Version 1.11, September 2011
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 2
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
Notices
Warranty
All products manufactured by ICP DAS are under warranty regarding defective
materials for a period of one year, beginning from the date of delivery to the original
purchaser.
Warning
ICP DAS assumes no liability for any damage resulting from the use of this
product.ICP DAS reserves the right to change this manual at any time without
notice.The information furnished by ICP DAS is believed to be accurate and
reliable.However, no responsibility is assumed by ICP DAS for its use, not for any
infringements of patents or other rights of third parties resulting from its use.
Copyright
Copyright @ 2011 by ICP DAS Co., Ltd.All rights are reserved.
Trademark
The names used for identification only may be registered trademarks of their
respective companies.
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 3
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
TABLE OF CONTENTS
TABLE OF CONTENTS ............................................................................................................ 3
1. GEOMETRY API .................................................................................................................. 8
1.1. hmi_DrawLine ..............................................................................................................................................9
1.2. hmi_DrawRect .......................................................................................................................................... 11
1.3. hmi_FillRect ............................................................................................................................................... 13
1.4. hmi_DrawCircle ....................................................................................................................................... 15
1.5. hmi_FillCircle ............................................................................................................................................ 17
1.6. hmi_DrawEllipse ...................................................................................................................................... 19
1.7. hmi_FillEllipse ........................................................................................................................................... 21
1.8. hmi_DrawPolyLine ................................................................................................................................. 23
1.9. hmi_DrawPolygon .................................................................................................................................. 25
1.10. hmi_FillPolygon ..................................................................................................................................... 27
2. FRAME API ............................................................................................................................ 29
2.1. hmi_GotoFrameByName .................................................................................................................... 30
2.2. hmi_IndexOfFrameName .................................................................................................................... 31
3. TCP API ................................................................................................................................... 32
3.1. hmi_TCPInit ............................................................................................................................................... 33
3.2. hmi_TCPNew ............................................................................................................................................ 34
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 4
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
3.3. hmi_TCPListen ........................................................................................................................................ 35
3.4. hmi_TCPOpen.......................................................................................................................................... 37
3.5. hmi_TCPClose ......................................................................................................................................... 39
3.6. hmi_TCPGetLocalPort ......................................................................................................................... 40
3.7. hmi_TCPGetRemotePort .................................................................................................................... 41
3.8. hmi_TCPState .......................................................................................................................................... 42
3.9. hmi_TCPWrite .......................................................................................................................................... 44
3.10. hmi_TCPOutput .................................................................................................................................... 46
3.11. hmi_TCPRead ....................................................................................................................................... 48
3.12. hmi_TCPSendCmd ............................................................................................................................. 50
4. MODBUS TCP MASTER API ........................................................................................... 52
4.1. mbm_Register .......................................................................................................................................... 53
4.2. mbm_Unregister ...................................................................................................................................... 55
4.3. mbm_WriteDO .......................................................................................................................................... 56
4.4. mbm_ReadDO ......................................................................................................................................... 58
4.5. mbm_ReadDI ............................................................................................................................................ 60
4.6. mbm_WriteAO .......................................................................................................................................... 62
4.7. mbm_ReadAO.......................................................................................................................................... 64
4.8. mbm_ReadAI ............................................................................................................................................ 66
5. MODBUS RTU MASTER API ........................................................................................... 68
5.1. mrm_WriteDO ..................................................................................................................................... 69
5.2. mrm_ReadDO ..................................................................................................................................... 71
5.3. mrm_ReadDI ....................................................................................................................................... 73
5.4. mrm_WriteAO ..................................................................................................................................... 75
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 5
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
5.5. mrm_ReadAO ..................................................................................................................................... 77
5.6. mrm_ReadAI ....................................................................................................................................... 79
6. UART API ............................................................................................................................... 81
6.1. uart_Open ............................................................................................................................................. 82
6.2. uart_Close ............................................................................................................................................ 84
6.3. uart_Send ............................................................................................................................................. 85
6.4. uart_Recv .............................................................................................................................................. 86
6.5. uart_SendCmd ................................................................................................................................... 87
6.6. uart_SetTimeOut ............................................................................................................................... 89
6.7. uart_EnableCheckSum .................................................................................................................. 90
6.8. uart_SetTerminator ........................................................................................................................... 91
6.9. uart_BinSend ...................................................................................................................................... 92
6.10. uart_BinRecv .................................................................................................................................. 93
6.11. uart_BinSendCmd ........................................................................................................................ 94
7. DCON_IO API ........................................................................................................................ 96
7.1. dcon_WriteDO .................................................................................................................................... 97
7.2. dcon_WriteDOBit ............................................................................................................................... 99
7.3. dcon_ReadDO ................................................................................................................................. 101
7.4. dcon_ReadDI ................................................................................................................................... 103
7.5. dcon_ReadDIO ............................................................................................................................... 105
7.6. dcon_ReadDILatch........................................................................................................................ 107
7.7. dcon_ClearDILatch........................................................................................................................ 109
7.8. dcon_ReadDIOLatch .................................................................................................................... 110
7.9. dcon_ClearDIOLatch .................................................................................................................... 112
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 6
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
7.10. dcon_ReadDICNT ..................................................................................................................... 113
7.11. dcon_ClearDICNT ..................................................................................................................... 115
7.12. dcon_WriteAO ............................................................................................................................. 117
7.13. dcon_ReadAO ............................................................................................................................ 119
7.14. dcon_ReadAI ............................................................................................................................... 121
7.15. dcon_ReadAIHex ...................................................................................................................... 123
7.16. dcon_ReadAIAll ......................................................................................................................... 125
7.17. dcon_ReadAIAllHex ................................................................................................................. 127
7.18. dcon_ReadCNT ......................................................................................................................... 129
7.19. dcon_ClearCNT ......................................................................................................................... 131
7.20. dcon_ReadCNTOverflow ....................................................................................................... 133
8. WIDGET API ....................................................................................................................... 135
8.1. TextButtonTagGet .......................................................................................................................... 136
8.2. TextButtonTagSet ........................................................................................................................... 138
8.3. ObjButtonTagGet ............................................................................................................................ 140
8.4. ObjButtonTagSet ............................................................................................................................ 142
8.5. TextButtonTextGet ......................................................................................................................... 144
8.6. TextButtonTextSet .......................................................................................................................... 146
8.7. SliderTagGet ..................................................................................................................................... 148
8.8. SliderTagSet ..................................................................................................................................... 150
8.9. BitButtonTagGet .............................................................................................................................. 152
8.10. BitButtonTagSet ......................................................................................................................... 154
8.11. HotSpotLastXGet ...................................................................................................................... 156
8.12. HotSpotLastYGet ...................................................................................................................... 158
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 7
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
8.13. HotSoptTagGet ........................................................................................................................... 160
8.14. HotSoptTagSet ........................................................................................................................... 162
8.15. CheckBoxSelectedGet ............................................................................................................ 164
8.16. CheckBoxTagGet ...................................................................................................................... 166
8.17. CheckBoxTagSet ....................................................................................................................... 168
8.18. LabelTextGet ............................................................................................................................... 170
8.19. LabelTextSet ................................................................................................................................ 172
8.20. TimerEnabledGet ...................................................................................................................... 174
8.21. TimerEnabledSet ....................................................................................................................... 176
9. MISCELLANEOUS API ................................................................................................... 178
9.1. hmi_SetForeground ...................................................................................................................... 179
9.2. hmi_Beep ........................................................................................................................................... 180
9.3. hmi_ConfigBeep ............................................................................................................................. 181
9.4. hmi_GetRotaryID ........................................................................................................................... 182
9.5. hmi_SetLED ...................................................................................................................................... 183
9.6. hmi_BacklightSet ........................................................................................................................... 184
9.7. hmi_GetTickCount ......................................................................................................................... 185
9.8. hmi_DelayUS ................................................................................................................................... 186
9.9. hmi_UserFlashErase .................................................................................................................... 187
9.10. hmi_UserFlashRead ................................................................................................................ 189
9.11. hmi_UserFlashWrite ................................................................................................................ 191
9.12. CRC16 ............................................................................................................................................ 193
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 8
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
1. GEOMETRY API
This chapter describes how to draw different shapes, such as rectangles, circles, etc.
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 9
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
1.1. HMI_DRAWLINE
Draw a line on TouchPAD.
Syntax
void hmi_DrawLine(
tContext *pContext,
int x1,
int y1,
int x2,
int y2
);
Parameter
pContext
[out] Specify the context.
x1
[in] The x-coordinate of the first vertex of the line segment to draw
y1
[in] The y-coordinate of the first vertex of the line segment to draw
x2
[in] The x-coordinate of the second vertex of the line segment to draw
y2
[in] The y-coordinate of the second vertex of the line segment to draw
Return Values
None.
Examples
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 10
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
[C]
hmi_DrawLine (pContext, x1, y1, x2, y2);
Remark
None
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 11
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
1.2. HMI_DRAWRECT
Draw a rectangle on TouchPAD.
Syntax
void hmi_DrawRect(
tContext *pContext,
int x1,
int y1,
int x2,
int y2
);
Parameter
pContext
[out] Specify the context.
x1
[in] The x-coordinate of the first diagonal vertex of the rectangle to draw
y1
[in] The y-coordinate of the first diagonal vertex of the rectangle to draw
x2
[in] The x-coordinate of the second diagonal vertex of the rectangle to draw
y2
[in] The y-coordinate of the second diagonal vertex of the rectangle to draw
Return Values
None.
Examples
[C]
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 12
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
hmi_DrawRect (pContext, x1, y1, x2, y2);
Remark
None
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 13
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
1.3. HMI_FILLRECT
Draw a rectangle and fill it with a specified color on TouchPAD.
Syntax
void hmi_FillRect(
tContext *pContext,
int x1,
int y1,
int x2,
int y2
);
Parameter
pContext
[out] Specify the context.
x1
[in] The x-coordinate of the first diagonal vertex of the rectangle to fill
y1
[in] The y-coordinate of the first diagonal vertex of the rectangle to fill
x2
[in] The x-coordinate of the second diagonal vertex of the rectangle to fill
y2
[in] The y-coordinate of the second diagonal vertex of the rectangle to fill
Return Values
None
Examples
[C]
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 14
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
hmi_FillRect (pContext, x1, y1, x2, y2);
Remark
None
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 15
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
1.4. HMI_DRAWCIRCLE
Draw a circle on TouchPAD.
Syntax
void hmi_DrawCircle(
tContext *pContext,
int x,
int y,
int w
);
Parameter
pContext
[out] Specify the context.
x
[in] The x-coordinate of the center of the circle to draw
y
[in] The y-coordinate of the center of the circle to draw
w
[in] The radius of the circle to draw
Return Values
None
Examples
[C]
hmi_DrawCircle (pContext, x, y, w);
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 16
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
Remark
None
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 17
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
1.5. HMI_FILLCIRCLE
Draw a circle and fill it with a specified color on TouchPAD.
Syntax
void hmi_FillCircle(
tContext *pContext,
int x,
int y,
int w
);
Parameter
pContext
[out] Specify the context.
x
[in] The x-coordinate of the center of the circle to fill
y
[in] The y-coordinate of the center of the circle to fill
w
[in] The radius of the circle to fill
Return Values
None
Examples
[C]
hmi_FillCircle (pContext, x, y, w);
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 18
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
Remark
None
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 19
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
1.6. HMI_DRAWELLIPSE
Draw an ellipse on TouchPAD.
Syntax
void hmi_DrawEllipse(
tContext *pContext,
int x1,
int y1,
int x2,
int y2
);
Parameter
pContext
[out] Specify the context.
x1
[in] The x-coordinate of the first diagonal vertex of the rectangular that inscribes
the ellipse to draw
y1
[in] The y-coordinate of the first diagonal vertex of the rectangular that inscribes
the ellipse to draw
x2
[in] The x-coordinate of the second diagonal vertex of the rectangular that
inscribes the ellipse to draw
y2
[in] The y-coordinate of the second diagonal vertex of the rectangular that
inscribes the ellipse to draw
Return Values
None
HMIWorks API Reference version 1.11 Last Revised: September 2011 Page: 20
Copyright © 2011 ICP DAS Co., Ltd. All Rights Reserved. E-mail: servic[email protected]
Examples
[C]
hmi_DrawEllipse(pContext, x1, y1, x2, y2);
Remark
None
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132
  • Page 133 133
  • Page 134 134
  • Page 135 135
  • Page 136 136
  • Page 137 137
  • Page 138 138
  • Page 139 139
  • Page 140 140
  • Page 141 141
  • Page 142 142
  • Page 143 143
  • Page 144 144
  • Page 145 145
  • Page 146 146
  • Page 147 147
  • Page 148 148
  • Page 149 149
  • Page 150 150
  • Page 151 151
  • Page 152 152
  • Page 153 153
  • Page 154 154
  • Page 155 155
  • Page 156 156
  • Page 157 157
  • Page 158 158
  • Page 159 159
  • Page 160 160
  • Page 161 161
  • Page 162 162
  • Page 163 163
  • Page 164 164
  • Page 165 165
  • Page 166 166
  • Page 167 167
  • Page 168 168
  • Page 169 169
  • Page 170 170
  • Page 171 171
  • Page 172 172
  • Page 173 173
  • Page 174 174
  • Page 175 175
  • Page 176 176
  • Page 177 177
  • Page 178 178
  • Page 179 179
  • Page 180 180
  • Page 181 181
  • Page 182 182
  • Page 183 183
  • Page 184 184
  • Page 185 185
  • Page 186 186
  • Page 187 187
  • Page 188 188
  • Page 189 189
  • Page 190 190
  • Page 191 191
  • Page 192 192
  • Page 193 193
  • Page 194 194

ICP DAS USA VPD-130-H User manual

Type
User manual
This manual is also suitable for

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI