公司地址: | 廣東省深圳市寶安區松崗鎮上山門社區潤發大廈903 |
公司電話: | 075529909265 |
公司傳真: | 075527091524 |
商務手機: | 13480903564 |
聯 系 人: | 高先生 |
公司郵箱: |
深圳精展達自動化高工13480903564一級代理LGPLC,西門子PLC,LG變頻器,LG觸摸屏,威綸觸摸屏,威綸變頻器,weinview觸摸屏,eview觸摸屏,sunfar變頻器,雷賽LEADSHINE步進,,雷賽伺服等自動化產品兼具非標設備程序編程開發與觸摸屏維修,質量保證,價格優惠,買工控,精展達!網站:http://www.weiluneview.com,官網:www.szjzdjd.com。
數據轉函數
|
函數名稱 |
BIN2BCD |
|
||
|
語法 |
BIN2BCD(source, result) |
|
||
|
描述 |
將 BIN 格式的數據 (source) 轉換為 BCD 格式的數據 (result)。數據來源 source |
|||
|
|
可以是常數或者變量,但是存放結果的 result 必須為變量。 |
|||
|
|
|
|
||
|
舉例 |
macro_command main() |
|
||
|
|
short source, result |
|
||
|
|
BIN2BCD(1234, result) |
// result is 0x1234 |
||
|
|
source = 5678 |
|
||
|
|
BIN2BCD(source, result) |
// result is 0x5678 |
||
|
|
end macro_command |
|
||
|
|
|
|
||
|
函數名稱 |
BCD2BIN |
|
||
|
語法 |
BCD2BIN(source, result) |
|
||
|
描述 |
將 BCD 格式的數據 (source) 轉換為 BIN 格式的數據 (result)。數據來源 source |
|||
|
|
可以是常數或者變量,但是存放結果的 result 必須為變量。 |
|||
|
|
|
|
||
|
舉例 |
macro_command main() |
|
||
|
|
short source, result |
|
||
|
|
BCD2BIN(0x1234, result) |
// result is 1234 |
||
|
|
source = 0x5678 |
|
||
|
|
BCD2BIN(source, result) |
// result is 5678 |
||
|
|
end macro_command |
|
||
|
函數名稱 |
DEC2ASCII |
|||
|
語法 |
DEC2ASCII(source, result[start], len) |
|||
|
描述 |
將十進制的數據 (source) 轉換為 ASCII 格式的數據,并存放在一個一維數組 |
|||
|
|
(result) 中。len 表示這個轉換后的字符串的長度,同時這個長度也取決于存放結果 |
|||
|
|
的一維數組的數據格式。例如:如果 resul t 一維數組的格式為“char” (字符型, |
|||
|
|
長度為一個字節) ,則長度為 ‚字節數*len‛ 。如果 result 一維數組的格式為 |
|||
|
|
‚short‛ (短整型數據,2 個字節) ,則長度為 ‚word*len‛。依此類推。 |
|||
|
|
轉換后的第一個字符放在 result‛start‛ 中,第二個字符放在 result‛start+1‛ |
|||
|
|
中,最后一個字符放在 result‛start+(len-1)‛中。 |
|||
|
|
source 和 len 可以是常數或者變量,單數 result 必須為變量。start 必須為常數。 |
|||
|
|
|
|||
|
舉例 |
macro_command main() |
|||
|
|
short source |
|||
|
|
char result1[4] |
|||
|
|
short result2[4] |
|||
|
|
source = 5678 |
|||
|
|
DEC2ASCII(source, result1[0], 4) |
|||
|
|
// result1[0] is '5', result1[1] is '6', result1[2] is '7', result1[3] is '8' |
|||
|
|
// the length of the string (result1) is 4 bytes( = 1 * 4) |
|||
|
|
DEC2ASCII(source, result2[0], 4) |
|||
|
|
// result2[0] is '5', result2[1] is '6', result2[2] is '7', result2[3] is '8' |
|||
|
|
// the length of the string (result2) is 8 bytes( = 2 * 4) |
|||
|
|
end macro_command |
|||
|
|
|
|||
|
函數名稱 |
HEX2ASCII |
|||
|
語法 |
HEX2ASCII(source, result‛start‛, len) |
|||
|
描述 |
十六進制格式數據 (source) 轉換為 ASCII 格式的數據,并將結果存放在一個一維數 |
|||
|
|
組 (result) 中。len 表示這個轉換后的字符串的長度,同時這個長度也取決于存放結 |
|||
|
|
果的一維數組的數據格式。例如:如果 result 一維數組的格式為‚char‛ (字符型, |
|||
|
|
長度為一個字節),則長度為 ‚字節數*len‛。如果 result 一維數組的格式為 |
|||
|
|
‚short‛ (短整型數據,2 個字節),則長度為 ‚word*len‛。依此類推。 |
|||
|
|
source 和 len 可以是常數或者變量,單數 result 必須為變量。start 必須為常數。 |
|||
|
|
|
|||
|
舉例 |
macro_command main() |
|||
|
|
short source |
|||
|
|
char result[4] |
|||
|
|
source = 0x5678 |
|||
|
|
HEX2ASCII(source, result[0], 4) |
|||
|
|
// result[0] is '5', result[1] is '6', result[2] is '7', result[3] is '8' |
|||
|
|
end macro_command |
|||
|
|
函數名稱 |
FLOAT2ASCII |
||
|
|
語法 |
FLOAT2ASCII (source, result[start], len) |
||
|
描述 |
浮點數格式數據 (source) 轉換為 ASCII 格式的數據,并將結果存放在一個一維數組 |
|||
|
|
|
(result) 中。len 表示這個轉換后的字符串的長度,同時這個長度也取決于存放結果 |
||
|
|
|
的一維數組的數據格式。例如:如果 result 一維數組的格式為 ‚char‛ (字符型, |
||
|
|
|
長度為一個字節),則長度為 ‚字節數*len‛。如果 result 一維數組的格式為 |
||
|
|
|
‚short‛ (短整型數據,2 個字節),則長度為 ‚word*len‛。依此類推。 |
||
|
|
|
source 和 len 可以是常數或者變量,單數 result 必須為變量。start 必須為常數。 |
||
|
|
|
|||
|
舉例 |
macro_command main() |
|||
|
|
|
float source |
||
|
|
|
char result[4] |
||
|
|
|
source = 56.8 |
||
|
|
|
FLOAT2ASCII (source, result[0], 4) |
||
|
|
|
// result[0] is '5', result[1] is '6', result[2] is '.', result[3] is '8' |
||
|
|
|
end macro_command |
||
|
|
|
|||
|
|
函數名稱 |
ASCII2DEC |
||
|
|
語法 |
ASCII2DEC(source[start], result, len) |
||
|
描述 |
將字符型 ASCII 數據 (source) 轉換為十進制格式的數據,并存放在 result 變數中。 |
|||
|
|
|
ASCII 的長度即為 len,第一個字符的位置即為 source[start] 的數據。 |
||
|
|
|
source 和 len 可以是常數或者變量,單數 result 必須為變量。start 必須為常數。 |
||
|
|
|
|||
|
舉例 |
macro_command main() |
|||
|
|
|
char source[4] |
||
|
|
|
short result |
||
|
|
|
source[0] = '5' |
||
|
|
|
source[1] = '6' |
||
|
|
|
source[2] = '7' |
||
|
|
|
source[3] = '8' |
||
|
|
|
ASCII2DEC(source[0], result, 4) // result is 5678 |
||
|
|
|
end macro_command |
||
|
函數名稱 |
ASCII2HEX |
|
||
|
語法 |
ASCII2HEX (source[start], result, len) |
|||
|
描述 |
將 ASCII 字符型數據 (source) 轉換為十六進制的數據,并存放在 result 變數中。 |
|||
|
|
字符的長度即為 len 的數據。第一個字符存放在 source[start] 中。 |
|||
|
|
source 和 len 可以是常數或者變量,單數 result 必須為變量。start 必須為常數。 |
|||
|
|
|
|
||
|
舉例 |
macro_command main() |
|
||
|
|
char source[4] |
|
||
|
|
short result |
|
||
|
|
source[0] = '5' |
|
||
|
|
source[1] = '6' |
|
||
|
|
source[2] = '7' |
|
||
|
|
source[3] = '8' |
|
||
|
|
ASCII2HEX(source[0], result, 4) |
// result is 0x5678 |
||
|
|
end macro_command |
|
||
|
|
|
|
||
|
函數名稱 |
ASCII2FLOAT |
|
||
|
語法 |
ASCII2FLOAT (source[start], result, len) |
|||
|
描述 |
將字符型 ASCII 數據 (source) 轉換為浮點數格式的數據,并存放在 result 變數中。 |
|||
|
|
ASCII 的長度即為 len,第一個字符的位置為 source[start] 的數據。 |
|||
|
|
source 和 len 可以是常數或者變量,單數 result 必須為變量。Start 必須為常數。 |
|||
|
|
|
|
||
|
舉例 |
macro_command main() |
|
||
|
|
char source[4] |
|
||
|
|
float result |
|
||
|
|
source[0] = '5' |
|
||
|
|
source[1] = '6' |
|
||
|
|
source[2] = '.' |
|
||
|
|
source[3] = '8' |
|
||
|
|
ASCII2FLOAT(source[0], result, 4) |
// result is 56.8 |
||
|
|
end macro_command |
|
||
下一章節講解數據操作函數!
威綸觸摸屏精展達有售全部型號,也有觸摸屏維修的服務,現在將在售的型號公布:
4.3寸:TK6051IP,MT6051IP(準備停產),MT8051IP,MT8050IE
7寸不帶網口:TK6071IQ,TK6071IP,MT6071IP,MT6071IE
7寸帶網口:TK8071IP,MT8071IP,MT8071IE
10寸寸不帶網口:MT6102IQ(即將停產)MT6103IP
10寸帶網口:MT8102IQ(全新上市,價格超好)MT8102IP,MT8101E,MT8102IE,MT8103IE
12寸:MT8121IE
15寸:MT8151IE
從4.3寸到15寸,您心動哪一款了?電話咨詢13480903564微信同號!另外國內外品牌觸摸屏維修也是精展達的服務之一!
三菱PLC,西門子PLC,歐姆龍PLC,LSPLC威綸觸摸屏,昆侖通泰(MCGS)觸摸屏,四方(SUNFAR)變頻器,LG變頻器,威綸通變頻器,雷賽步進,雷賽伺服,英威騰伺服一般工控軟件我們都有,價格您覺得合適就下單,但是質量我們絕對是有保證!
觸摸屏維修也是精威的強項服務!觸摸屏維修的故障包含:漂移、觸摸不準、破屏、碎屏、無法觸摸、花屏、橫屏、豎屏、黑屏、無法通訊等常見故障。我們快捷24小時維修到位!
Copyright 2009-2011,威綸通商城
,All rights reserved
weinview|威綸通|TK6071IQ|TK6071IP|MT8102IE|一級代理
Powered by aspcms
精展達自動化 版權所有
威綸通一級代理