完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨Uli13,是的,你可以通过以太网与任何设备通信,ping是检查连接工作的好方法。
1.决定哪一端是'服务器'(通常是'哑'端只响应命令,而不是煽动它们),当然另一端是驱动该过程的客户端; 如果你想要一个起始点使RPi成为服务器端2.在RPi上你需要编写一个服务器或者在VEE中运行一个* 3.,选择一个I / O - > To / From Socket对象并设置它 将端口连接到RPi的地址和服务器在步骤2中打开的端口[编号] .4。通常,您将成对进行交易 - 双击它所说的位置并输入类似的内容(包括引号,除非 你正在从输入引脚获取数据):WRITE TEXT“give_me_something”EOL - 其中give_me_something是你提供给RPi服务器的命令或数据,用于从中请求内容 - 然后是一行来读取数据:通常使用字符串格式 直到你知道返回的数据类型是真实的或int或任何例如 READ TEXT x STR 5.将添加一个输出引脚x,当(a)服务器在RPi上运行并且(b)运行您的VEE程序时,它将具有从RPi返回的数据的内容。 RPi超出了本论坛的范围 - 我不知道你在这方面的经验是什么......如果你'只是尝试'那么你很可能在Python的网络上找到用于Python或C的RPi的例子 或者你甚至可以在RPi上运行Java。 Scratch可能有一个以太网通信扩展 - 我发现有一天你可以控制硬件:-)最基本的,服务器需要绑定到一个端口并接受连接,然后它需要响应 发送的命令和数据,例如,如果它接收到以换行符结束的“give_me_something”,它(比如说)测量房间的温度并返回该值。 HTH,迈克 以上来自于谷歌翻译 以下为原文 Hi Uli13, Yes you can communicate with any device over Ethernet and a ping is a good way to check the connection works. 1. decide which end is the 'server' ( typically the 'dumb' end that only responds to commands, not instigating them ) and of course the other end is the client which drive the process; if you want a start point make the RPi the server end 2. on the RPi you'll need to code a server or have one running * 3. in VEE, select an I/O -> To/From Socket object and set it to Connect Port to address of the RPi and the port [number] as opened by the server in step 2. 4. typically you'll have transactions in pairs - double-click where it says and enter one something like ( include the quotes unless you are taking data from an input pin ): WRITE TEXT "give_me_something" EOL - where give_me_something is the command or data you are providing to the RPi server to request something from it - then a line to read the data: in general use string format until you know the data type being returned is real or int or whatever e.g. READ TEXT x STR 5. that will add an output pin x which will have the contents of the data returned from the RPi when (a) the server is running on the RPi and (b) you run your VEE program * The server on the RPi is beyond the scope of this forum - I don't know what your experience with that end is... if you are 'just trying it out' then you may well find examples on the 'net for the RPi in Python or C or you can even get Java running on the RPi. There may well be an Ethernet comms extension for Scratch - I found out the other day you can control hardware with that :-) At its most basic, the server needs to bind to a port and accept a connection, then it needs to respond to commands and data being sent, for example if it receives "give_me_something" terminated with a newline character it ( say ) measures the temperature of the room and returns the value. HTH, Mike |
|
|
|
bgvywerq 发表于 2018-10-1 12:48 感谢您的回复。 也许我做错了,但我不能做你告诉我的事,因为VEE没有检测到我的Raspberry Pi。 我试图使用“To / From Socket对象”,但是当我运行它时会出现一条消息,如“此Ip地址中的任何设备”,我希望VEE是服务器,RPi是客户端。 我已经完成了服务器和客户端。 再次感谢!! 关心Uli13 以上来自于谷歌翻译 以下为原文 thanks for reply. Maybe i'm doing it wrong, but i cant do what you tell me because VEE doesn't detect my Raspberry Pi. I tried to use "To/From Socket object" but when i run it appears a message like "Any device in this Ip Address" I want VEE be the server and RPi the client. i have done the server and client. thanks again!! Regards Uli13 |
|
|
|
骑海豚的少年 发表于 2018-10-1 12:54 我不明白你的意思是“VEE没有检测到我的Raspberry Pi”。 VEE将检测大多数仪器。 RPi只是驻留在您网络上的另一个地址。 如果要将VEE作为服务器,则在To / From Socket对象中单击按钮将其绑定到您选择的端口 - 这意味着它将监听传入的连接请求。 设置它正确运行的方式将是一个更大的挑战 - 套接字对象的无限超时意味着VEE程序将锁定直到它收到一些数据。 我要做的是使用Flow - > Until Break来ping To / From Socket; 添加一个错误输出引脚到一个事务READ x STR。 此刻不要将任何东西连接到错误引脚; 将显示 - >记录字母数字连接到x输出引脚。 现在,当您将数据或命令发送到由其主机地址和您指定的端口终止的VEE应用程序时,该应用程序应显示在该日志记录字段中。 一旦你的基本系统工作,你可以将x输出(比如说)提供给Flow - > IF / THEN / ELSE来确定接收到的内容,从而确定如何处理它。 干杯,迈克 以上来自于谷歌翻译 以下为原文 I don't understand what you mean by "VEE doesn't detect my Raspberry Pi". VEE will detect most instruments. The RPi simply resides at another address on your network. If VEE is to be the server, then in the To/From Socket object click the button to bind it to the port of your choosing - that means it will be listening to incoming connection requests. Setting up the way it runs correctly will be a bit more of a challenge - an infinite timeout on the socket object will mean the VEE program will lock up until it receives some data. What I would do is to use a Flow -> Until Break to ping the To/From Socket; add an error output pin to the that and a transaction READ x STR. Don't connect anything to the error pin at the moment; connect a Display -> Logging Alphanumeric to the x output pin. Now, when you send data or a command to the VEE application terminated by , at the address of its host and the port you specified, that should show up in that logging alphnumeric. Once you have that basic system working, you can feed the x output ( say ) to a Flow -> IF/THEN/ELSE to determine what has been received and therefore what to do about it. Cheers, Mike |
|
|
|
只有小组成员才能发言,加入小组>>
1283 浏览 0 评论
2371 浏览 1 评论
2189 浏览 1 评论
2062 浏览 5 评论
2946 浏览 3 评论
1105浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
752浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
923浏览 0评论
1285浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 04:22 , Processed in 1.407017 second(s), Total 83, Slave 65 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号