Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > มีโปรเจคเขียนโปรแกรม winwedge ให้ติดต่อผ่าน VB เริ่มต้นเลยครับ มีพื้นฐานแต่ PHP



 

มีโปรเจคเขียนโปรแกรม winwedge ให้ติดต่อผ่าน VB เริ่มต้นเลยครับ มีพื้นฐานแต่ PHP

 



Topic : 088318



โพสกระทู้ ( 27 )
บทความ ( 0 )



สถานะออฟไลน์




ต้องบอกก่อนว่าเริ่มต้นใหม่จริงๆครับ

คือมีเครื่องชั่งน้ำหนัก กับเครื่องคอมพิวเตอร์เชื่อมต่อกันผ่าน rs232 โดยมีโปรแกรม winwedge สำหรับรับค่าน้ำหนักทุกๆครั้งที่น้ำหนักเปลี่ยนไป

อยากเขียนให้ค่าใน winwedge ส่งไปที่โปรแกรมที่จะเพิ่มเติมคือ VB

อ่านแล้วงงๆอ่ะครับ ช่วยแปลให้เข้าใจง่ายๆ พร้อมเริ่มเขียนเลยได้ไหมครับ

DDE Examples for Microsoft Visual Basic for Windows

Linking a VB Text Box to a WinWedge Data Field

To link a data field in WinWedge to a text box in a VB application you simply set the properties for the
text box to specify a DDE link. For example the following code would establish a "Automatic" link
between field(1) in WinWedge (active on COM2) so that whenever data changes in Field(1) of
WinWedge, it would also automatically change in the text box Text1. When a data field from
WinWedge is linked to a text box on a VB form using a "Automatic" link, the text box will also receive
a "Change" event whenever the data from WinWedge changes. If you set the LinkMode property to
"Notify", the text box will receive a "LinkNotify" event whenever WinWedge updates the data for
Field(1) - even if the data does not change. Note: If you set the LinkMode to "Notify" your
Text1_LinkNotify event handler will have to perform a "LinkRequest" method to update the textbox.
(i.e. Text1.LinkRequest)

Text1.LinkTopic = "winwedge|com2" ' set the link topic
Text1.LinkItem = "field(1)" ' set the link item
Text1.LinkMode = vbLinkAutomatic ' set the link mode to "Automatic"

Sending DDE Commands To WinWedge From A VB Application.

After a link is established between a text box and a data field in WinWedge, you could issue
commands to WinWedge using the text box "LinkExecute Method". For Example the following code
sends the string "Testing" followed by a carriage return out the serial port.

Note: WinWedge must be active on the specified serial port for the following code to work.

Text2.linkmode =vbLinkNone ' disable links before setting topic
Text2.LinkTopic = "winwedge|com2" ' set the link topic
' there is no need to set the LinkItem property when sending DDE commands
Text2.LinkMode = vbLinkNotify ' set the link mode to "Notify"
Text2.LinkExecute "[Sendout('Testing',13)]" ' send the string out the serial port

Launching WinWedge From A Visual Basic Application

Sub RunWedge()
' the shell statement passes a WinWedge config file as a command line arg.
' This causes WinWedge to automatically load the config file and activate itself.
x& = Shell("c:\winwedge\winwedge.exe c:\winwedge\ddetest.SW3")
ThreeSecsFromNow = TimeValue(Now) + TimeValue("00:00:03")
Do While TimeValue(Now) < ThreeSecsFromNow
DoEvents ' give WinWedge time to load
Loop
End Sub ' WinWedge should be loaded now



Tag : .NET









ประวัติการแก้ไข
2012-12-20 16:39:45
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-12-20 16:38:23 By : kung59287 View : 1509 Reply : 1
 

 

No. 1

Guest


dde เป็นโปรโตคอลโบราณที่ใช้ส่ง windows message ระหว่าง app

vb ที่พูดถึงก็คง vb6

ลองหา dde ที่เป็น .net แล้วศึกษาดู เพราะ vb6 ก็เก่าแล้วเช่นกัน






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-20 17:13:33 By : ห้ามตอบเกินวันละ 2 กระทู้
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : มีโปรเจคเขียนโปรแกรม winwedge ให้ติดต่อผ่าน VB เริ่มต้นเลยครับ มีพื้นฐานแต่ PHP
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่