■ 戻 る ■ i2net HOME ■ HTBASIC HOME | HTBasic-USBS Driver / TAMS1805A |
![]() |
パワー/シグナル スィッチ モジュール
|
HTBasicサンプルプログラム |
!************************************************************************************************* !** ** !** Program: USBS Example ** !** ** !** Description: This example demonstrates using the new USBS driver to control a USB ** !** device. It shows how standard I/O commands can be used to send and receive ** !** commands using the USBS driver. ** !** ** !************************************************************************************************* CLEAR SCREEN !**************************************** Reset the Device *************************************** RESET 7 !*********************************** Set up a 5 Second Timeout *********************************** ON TIMEOUT 7,5 GOSUB Finish !************************************* Get Device Identifier ************************************* PRINT "Command: *IDN?" OUTPUT 7;"*IDN?"; ENTER 7;S$ PRINT S$&CHR$(13)&CHR$(10) WAIT 2 FOR X=0 TO 10 !*************************************** Close relays 1 - 5 ************************************* Output_dev("CLOSE (@1)") Output_dev("CLOSE (@2)") Output_dev("CLOSE (@3)") Output_dev("CLOSE (@4)") Output_dev("CLOSE (@5)") !*************************************** Open relays 1 - 5 ************************************** Output_dev("OPEN (@1)") Output_dev("OPEN (@2)") Output_dev("OPEN (@3)") Output_dev("OPEN (@4)") Output_dev("OPEN (@5)") NEXT X Finish: END !******************************** Subprogram that Outputs commands ****************************** SUB Output_dev(Cmd$) PRINT Cmd$ OUTPUT 7;Cmd$; WAIT .1 SUBEND |
アイネット株式会社 TEL:03-5623-2301(代表) FAX:03-5623-2305 E-mailでのお問い合わせ _/_/_/ Copyright 1998-2009 I2NET Co., Ltd. AllRights Reserved. _/_/_/ |