• VEXcode Robotics Logo VEX Robotics Logo
  • VEX API Home Button VEX API Home Button
  • VEX 123 logo in purple VEX 123 logo in white
  • VEX GO logo in lime green VEX GO logo in white
  • VEXcode AIM logo in blue VEXcode AIM logo in white
  • VEX IQ logo in blue VEX IQ logo in white
  • VEX EXP logo in red VEX EXP logo in white
  • VEX V5 logo in red VEX V5 logo in white
  • VEX CTE logo in green VEX CTE logo in white
  • VEX AIR logo in orange VEX AIR logo in white
  • VEXcode VR logo in gold VEXcode VR logo in white
പ്രധാന ഉള്ളടക്കത്തിലേക്ക് പോകുക
Ctrl+K

< Back to Platform Select

  • VEX EXP
  • VEX EXP API റഫറൻസ്
  • VEXലിങ്ക്
  • സന്ദേശ ലിങ്ക്
മലയാളം
  • English
  • العربية
  • বাংলা
  • Česky
  • Deutsch
  • Ελληνικά
  • Español
  • Español Latinoamericano
  • Suomi
  • Français
  • Gaeilge
  • हिंदी
  • Magyar
  • Bahasa Indonesia
  • 日本語
  • 한국어
  • Lietuvių
  • Latviešu
  • Nederlands
  • Polski
  • Português
  • Русский
  • Svenska
  • ไทย
  • Türkçe
  • Українська
  • Tiếng Việt
  • 简体中文
  • 繁體中文
  • VEXcode Robotics Logo

വിഭാഗം നാവിഗേഷൻ

  • ബ്ലോക്കുകൾ
  • Python
    • ഡ്രൈവ്‌ട്രെയിൻ
    • ചലനം
    • ശബ്ദം
    • ദർശനം
    • സ്ക്രീൻ
    • കൺട്രോളർ
    • സെൻസിംഗ്
    • നിഷ്ക്രിയത്വം
    • 3-വയർ ഉപകരണങ്ങൾ
    • ന്യൂമാറ്റിക്
    • തലച്ചോറ്
    • SD കാർഡ്
    • 6-ആക്സിസ് ആം
    • സിഗ്നൽ ടവർ
    • VEXലിങ്ക്
      • സന്ദേശ ലിങ്ക്
      • സീരിയൽ ലിങ്ക്
    • കൺസോൾ
    • ലോജിക്
    • മൈക്രോപൈത്തൺ ലൈബ്രറികൾ
  • C++
  • VEXcode ട്യൂട്ടോറിയലുകൾ

പ്ലാറ്റ്‌ഫോം നാവിഗേഷൻ

  • VEX 123 logo in purple VEX 123 logo in white
  • VEX GO logo in lime green VEX GO logo in white
  • VEXcode AIM logo in blue VEXcode AIM logo in white
  • VEX IQ logo in blue VEX IQ logo in white
  • VEX EXP logo in red VEX EXP logo in white
  • VEX V5 logo in red VEX V5 logo in white
  • VEX CTE logo in green VEX CTE logo in white
  • VEX AIR logo in orange VEX AIR logo in white
  • VEXcode VR logo in gold VEXcode VR logo in white

സന്ദേശ ലിങ്ക്#

  • ആമുഖം

  • ഒരു ലിങ്ക് സൃഷ്ടിക്കുക

  • ലഭ്യമായ രീതികൾ

    • ലിങ്ക് ചെയ്‌തിരിക്കുന്നു

    • അയയ്ക്കുക

    • സ്വീകരിക്കുക

    • ലഭിച്ചു

ആമുഖം#

മെസേജ് ലിങ്ക് രണ്ട് EXP ബ്രെയിനുകളെ ഓപ്ഷണൽ ചെറിയ ഡാറ്റ ഉപയോഗിച്ച് ഷോർട്ട് സ്ട്രിംഗ് സന്ദേശങ്ങൾ അയച്ചുകൊണ്ട് ആശയവിനിമയം നടത്താൻ അനുവദിക്കുന്നു. റോബോട്ട്-ടു-റോബോട്ട് ഏകോപനത്തിനായി ഇത് രൂപകൽപ്പന ചെയ്‌തിരിക്കുന്നു - ദിനചര്യകൾ ആരംഭിക്കുക, സെൻസർ ഫലങ്ങൾ പങ്കിടുക, അല്ലെങ്കിൽ മറ്റൊരു റോബോട്ടിൽ പെരുമാറ്റങ്ങൾ ട്രിഗർ ചെയ്യുക എന്നിവ പോലെ.

send ന്റെ ഓരോ ഉപയോഗവും ലിങ്ക് ചെയ്‌ത EXP ബ്രെയിനിന്റെ ക്യൂവിലേക്ക് ഒരു സന്ദേശം ചേർക്കുന്നു, കൂടാതെ ക്യൂ ആദ്യം വായിക്കുകയും ആദ്യം പുറത്തുവരികയും ചെയ്യുന്നു (FIFO). മറ്റ് EXP ബ്രെയിൻ receive ഉപയോഗിക്കുന്നതിന് മുമ്പ് ഒന്നിലധികം സന്ദേശങ്ങൾ അയച്ചാൽ, അവ സൂക്ഷിച്ച് അവ അയച്ച ക്രമത്തിൽ ഓരോന്നായി തിരികെ നൽകും. സന്ദേശങ്ങൾക്ക് ക്യൂ ചെയ്യാൻ കഴിയുന്നതിനാൽ, ഓരോ ലൂപ്പിലും ഒരേ സ്റ്റാറ്റസ് ആവർത്തിച്ച് അയയ്ക്കുന്നത് ബാക്ക്‌ലോഗ് സൃഷ്ടിച്ചേക്കാം; സമയ-നിർണ്ണായക യുക്തിക്ക്, മൂല്യങ്ങൾ മാറുമ്പോൾ മാത്രം അയയ്ക്കുക.

പ്രധാനം: രണ്ട് റോബോട്ടുകളും ഒരേ സമയം MessageLink ഉപയോഗിക്കുന്ന പ്രോജക്ടുകൾ പ്രവർത്തിപ്പിക്കുന്നുണ്ടാകണം, അല്ലെങ്കിൽ സന്ദേശങ്ങളൊന്നും അയയ്ക്കുകയോ സ്വീകരിക്കുകയോ ചെയ്യില്ല.

ഈ പേജിൽ ഉദാഹരണ MessageLink നാമമായി link ഉപയോഗിക്കുന്നു. ആവശ്യാനുസരണം നിങ്ങളുടെ സ്വന്തം കോൺഫിഗർ ചെയ്ത പേര് ഉപയോഗിച്ച് അത് മാറ്റിസ്ഥാപിക്കുക.

ലഭ്യമായ രീതികളുടെ ഒരു ലിസ്റ്റ് താഴെ കൊടുക്കുന്നു:

  • is_linked – ഈ ബ്രെയിൻ അതിന്റെ ജോടിയാക്കിയ ബ്രെയിനുമായി സജീവമായി ബന്ധിപ്പിച്ചിട്ടുണ്ടോ എന്ന് നൽകുന്നു.

  • send – ജോടിയാക്കിയ തലച്ചോറിലേക്ക് ഒരു സന്ദേശം അയയ്ക്കുന്നു.

  • receiveലഭിക്കുന്നു – അടുത്ത ഇൻകമിംഗ് സന്ദേശത്തിനായി കാത്തിരുന്ന് തിരികെ നൽകുന്നു.

  • received – ഒരു പുതിയ സന്ദേശം ലഭിക്കുമ്പോഴെല്ലാം വിളിക്കേണ്ട ഒരു ഫംഗ്ഷൻ രജിസ്റ്റർ ചെയ്യുന്നു.

ഒരു ലിങ്ക് സൃഷ്ടിക്കുക#

രണ്ട് EXP ബ്രെയിനുകളിലും ഒരു മെസേജ് ലിങ്ക് സൃഷ്ടിക്കുക, അങ്ങനെ അവയ്ക്കിടയിൽ ഒരു ആശയവിനിമയ ചാനൽ സ്ഥാപിക്കുക - V5 റോബോട്ട് റേഡിയോകൾ ഉപയോഗിച്ച് വയർലെസ് ആയിട്ടോ അല്ലെങ്കിൽ ഒരു വയർഡ് സ്മാർട്ട് കേബിൾ വഴിയോ - അങ്ങനെ റോബോട്ടുകൾക്ക് പരസ്പരം സന്ദേശങ്ങൾ അയയ്ക്കാൻ കഴിയും.

MessageLink(smartport, name, linktype, wired)

പാരാമീറ്റർ

വിവരണം

smartport

ഈ ലിങ്കിനായി ഉപയോഗിക്കുന്ന സ്മാർട്ട് പോർട്ട് - V5 റോബോട്ട് റേഡിയോ ബന്ധിപ്പിച്ചിരിക്കുന്ന പോർട്ട് (വയർലെസ്) അല്ലെങ്കിൽ സ്മാർട്ട് കേബിൾ പ്ലഗ് ചെയ്തിരിക്കുന്ന (വയർഡ്). Ports.PORTx ഇവിടെ x എന്നത് പോർട്ട് നമ്പറാണ്.

name

ഈ ലിങ്ക് ഒരു സ്ട്രിംഗായി നൽകേണ്ട അദ്വിതീയ നാമം.
കുറിപ്പ്: മറ്റൊരു ടീമിന്റെ ലിങ്കുമായി അബദ്ധവശാൽ പൊരുത്തപ്പെടാതിരിക്കാൻ ഒരു അദ്വിതീയ ഐഡി സൃഷ്ടിക്കാൻ ഈ നാമം ദൈർഘ്യമേറിയതായിരിക്കണം.

linktype

ഈ ലിങ്ക് ജോഡിക്ക് ഈ ബ്രെയിൻ ഉപയോഗിക്കുന്ന റോൾ. ഓരോ ജോഡിയിലും ഒരു മാനേജർ ഉം ഒരു വർക്കർ ഉം ഉണ്ടായിരിക്കണം:

  • VexlinkType.MANAGER – കൂടുതലോ വലുതോ സന്ദേശങ്ങൾ അയയ്‌ക്കുന്ന റോബോട്ടിനായി ഉപയോഗിക്കുക. മാനേജർമാർക്ക് ഉയർന്ന ഔട്ട്‌ബൗണ്ട് ബാൻഡ്‌വിഡ്ത്ത് ഉണ്ട് (~1040 ബൈറ്റുകൾ/സെക്കൻഡ്).
  • VexlinkType.WORKER – കുറച്ച് അല്ലെങ്കിൽ ചെറിയ സന്ദേശങ്ങൾ അയയ്‌ക്കുന്ന റോബോട്ടിനായി ഉപയോഗിക്കുക. തൊഴിലാളികൾക്ക് കുറഞ്ഞ ഔട്ട്‌ബൗണ്ട് ബാൻഡ്‌വിഡ്ത്ത് (~520 ബൈറ്റുകൾ/സെക്കൻഡ്) ഉണ്ട്.

wired

ഓപ്ഷണൽ. ഈ ലിങ്ക് വയർ ആണോ വയർലെസ് ആണോ എന്നത് പരിഗണിക്കാതെ തന്നെ:

  • True – EXP ബ്രെയിനുകൾ ഒരു സ്മാർട്ട് കേബിൾ വഴി ബന്ധിപ്പിച്ചിരിക്കുന്നു.
  • False (സ്ഥിരസ്ഥിതി) – V5 റോബോട്ട് റേഡിയോകൾ ഉപയോഗിച്ച് EXP ബ്രെയിനുകൾ വയർലെസ് ആയി ബന്ധിപ്പിക്കുന്നു.

റോബോട്ട് 1 നുള്ള കോഡ്

"""
Create a wireless link in Port 1
name: VEXRoboticsLink123456789
linktype: Manager
"""
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.MANAGER)

റോബോട്ട് 2 നുള്ള കോഡ്

"""
Create a wireless link in Port 1
name: VEXRoboticsLink123456789
linktype: Worker
"""
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.WORKER)

ലഭ്യമായ രീതികൾ#

നിങ്ങളുടെ മെസേജ് ലിങ്ക് സജ്ജീകരിച്ച് ബ്രെയിൻസ് ലിങ്ക് ചെയ്‌തുകഴിഞ്ഞാൽ, സന്ദേശങ്ങൾ അയയ്‌ക്കാനും സ്വീകരിക്കാനും അവയോട് പ്രതികരിക്കാനും താഴെയുള്ള രീതികൾ നിങ്ങൾക്ക് ഉപയോഗിക്കാം.

is_linked#

is_linked രീതി ഒരു MessageLink-ലെ EXP ബ്രെയിനുകൾ പരസ്പരം ജോടിയാക്കുന്നുണ്ടോ എന്ന് നൽകുന്നു.

  • True – രണ്ട് EXP തലച്ചോറുകളും ഈ ലിങ്കിൽ ജോടിയാക്കപ്പെടുകയും ആശയവിനിമയം നടത്തുകയും ചെയ്യുന്നു.

  • False – ഈ ലിങ്കിൽ രണ്ട് EXP ബ്രെയിനുകളും ജോടിയാക്കിയിട്ടില്ല.

കുറിപ്പ്: കൂടുതൽ കോഡ് പ്രവർത്തിപ്പിക്കുന്നതിന് മുമ്പ് ഒരു പ്രോജക്റ്റിന്റെ തുടക്കത്തിൽ EXP ബ്രെയിനുകൾ ലിങ്ക് ചെയ്തിട്ടുണ്ടെന്ന് ഉറപ്പാക്കുന്നത് എപ്പോഴും നല്ല രീതിയാണ്.

Usage:
link.is_linked()

പാരാമീറ്ററുകൾ

വിവരണം

ഈ രീതിക്ക് പാരാമീറ്ററുകൾ ഇല്ല.

റോബോട്ട് 1 നുള്ള കോഡ്

# Tell the other robot when the screen is being pressed

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.MANAGER)

# Do not run code UNTIL the Brains are linked
while not link.is_linked():
    wait(0.1, SECONDS)

brain.screen.print("Robot 1 - Manager")

# Continuously send if the screen is being pressed
while True:
    if brain.screen.pressing():
        link.send("pressed")
    else:
        link.send("released")

    wait(50, MSEC)

റോബോട്ട് 2 നുള്ള കോഡ്

# Display if the other robot's screen is being pressed

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.WORKER)

# Do not run code UNTIL the Brains are linked
while not link.is_linked():
    wait(0.1, SECONDS)

# Continuously check if Robot 1 has sent "pressed"
while True:
    brain.screen.clear_screen()
    brain.screen.set_cursor(1, 1)
    brain.screen.print("Robot 2 - Worker")
    brain.screen.next_row()

    if link.receive() == "pressed":
        brain.screen.new_line()
        brain.screen.print("Manager is being pressed!")

    wait(50, MSEC)

send#

send മറ്റൊരു ലിങ്ക് ചെയ്‌ത EXP ബ്രെയിനിലേക്ക് ഒരു സ്ട്രിംഗ് കൂടാതെ/അല്ലെങ്കിൽ ഒരു പൂർണ്ണസംഖ്യ കൂടാതെ/അല്ലെങ്കിൽ ഫ്ലോട്ട് അയയ്ക്കുന്നു.

Usage:
send(string, integer, float)

പാരാമീറ്ററുകൾ

വിവരണം

string

ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റ് EXP ബ്രെയിനിലേക്ക് അയയ്‌ക്കേണ്ട സ്ട്രിംഗ്.

integer

ഓപ്ഷണൽ. ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു EXP ബ്രെയിനിലേക്ക് അയയ്‌ക്കേണ്ട ഒരു പൂർണ്ണസംഖ്യ.

float

ഓപ്ഷണൽ. ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു EXP ബ്രെയിനിലേക്ക് അയയ്‌ക്കേണ്ട ഒരു ഫ്ലോട്ട്. ഫ്ലോട്ടുകൾ 4 ദശാംശ സ്ഥാനങ്ങളിലേക്ക് ഫോർമാറ്റ് ചെയ്‌തിരിക്കുന്നു; കുറച്ച് ദശാംശങ്ങൾ നൽകിയിട്ടുണ്ടെങ്കിൽ, 4 കാണിക്കുന്നത് വരെ പിന്നിലുള്ള പൂജ്യങ്ങൾ ചേർക്കും.

string മാത്രം അയച്ചാൽ, ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റ് EXP ബ്രെയിനിന് ആ കൃത്യമായ സ്ട്രിംഗ് ലഭിക്കും.

integer ഉം/അല്ലെങ്കിൽ float ഉം ഉൾപ്പെടുത്തിയാൽ, സ്വീകരിക്കുന്ന തലച്ചോറിന് എല്ലാ ഫീൽഡുകളും ഈ ക്രമത്തിൽ സംയോജിപ്പിക്കുന്ന ഒരു എൻകോഡ് ചെയ്ത സ്ട്രിംഗ് ലഭിക്കും: .string_integer_float

ഉദാഹരണം: link.send(“string”, 1, 2.55) .string_1_2.5500.

റോബോട്ട് 1 നുള്ള കോഡ്

# Tell the other robot when the screen is being pressed

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.MANAGER)

# Do not run code UNTIL the Brains are linked
while not link.is_linked():
    wait(0.1, SECONDS)

brain.screen.print("Robot 1 - Manager")

# Continuously send if the screen is being pressed
while True:
    if brain.screen.pressing():
        link.send("pressed")
    else:
        link.send("released")

    wait(50, MSEC)

റോബോട്ട് 2 നുള്ള കോഡ്

# Display if the other robot's screen is being pressed

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.WORKER)

# Do not run code UNTIL the Brains are linked
while not link.is_linked():
    wait(0.1, SECONDS)

# Continuously check if Robot 1 has sent "pressed"
while True:
    brain.screen.clear_screen()
    brain.screen.set_cursor(1, 1)
    brain.screen.print("Robot 2 - Worker")
    brain.screen.next_row()

    if link.receive() == "pressed":
        brain.screen.new_line()
        brain.screen.print("Manager is being pressed!")

    wait(50, MSEC)

റോബോട്ട് 1 നുള്ള കോഡ്

# Tell the other robot where the screen was pressed

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.MANAGER)

# Do not run code UNTIL the Brains are linked
while not link.is_linked():
    wait(0.1, SECONDS)

brain.screen.print("Robot 1 - Manager")
brain.screen.next_row()
brain.screen.print("Tap to send circles")

# Send the coordinates whenever the screen is pressed
while True:
    if brain.screen.pressing():
        x = brain.screen.x_position()
        y = brain.screen.y_position()

        link.send("touch", x, y)

    wait(10, MSEC)

റോബോട്ട് 2 നുള്ള കോഡ്

# Draw a circle where Robot 1's screen was pressed

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.WORKER)

# Do not run code UNTIL the Brains are linked
while not link.is_linked():
    wait(0.1, SECONDS)

brain.screen.print("Robot 2 - Worker")

while True:
    # Get the full encoded string
    circle_coordinates = link.receive(200)

    if circle_coordinates:

        # Split the encoded string by _
        parts = circle_coordinates.split("_")

        if len(parts) == 3:
            # Convert the coordinates back into numbers
            x = float(parts[1])
            y = float(parts[2])

            brain.screen.set_fill_color(Color.WHITE)
            brain.screen.draw_circle(x, y, 20)

    wait(10, MSEC)

receive#

receive ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു EXP ബ്രെയിനിൽ നിന്നുള്ള അടുത്ത ക്യൂ ചെയ്‌ത സന്ദേശം തിരികെ നൽകുന്നു. സന്ദേശങ്ങൾ FIFO ക്രമത്തിലാണ് വായിക്കുന്നത് (പഴയതും വായിക്കാത്തതും ആദ്യം). receive വിളിക്കുമ്പോൾ ക്യൂ ശൂന്യമാണെങ്കിൽ, ഒരു പുതിയ സന്ദേശത്തിനായി നിർദ്ദിഷ്ട receive വരെ അത് കാത്തിരിക്കും. ആ വിൻഡോയിൽ ഒരു സന്ദേശവും വന്നില്ലെങ്കിൽ, receive timeoutനൽകുന്നു, തുടർന്ന് അയച്ച ഏതൊരു സന്ദേശവും അടുത്ത തവണ None ഉപയോഗിക്കുമ്പോൾ വായിക്കേണ്ട ക്യൂവിൽ തന്നെ തുടരും.

ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു EXP ബ്രെയിൻ ഒരു stringമാത്രമേ അയച്ചിട്ടുള്ളൂവെങ്കിൽ, receive ആ കൃത്യമായ സ്ട്രിംഗ് തിരികെ നൽകുന്നു.

ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു EXP ബ്രെയിൻ ഒരു പൂർണ്ണസംഖ്യയും/അല്ലെങ്കിൽ ഫ്ലോട്ടും അയച്ചാൽ, receive എല്ലാ ഫീൽഡുകളും ഈ ക്രമത്തിൽ സംയോജിപ്പിക്കുന്ന ഒരു എൻകോഡ് ചെയ്‌ത സ്ട്രിംഗ് തിരികെ നൽകുന്നു: .string_integer_float

ഉദാഹരണത്തിന്, ലിങ്ക് ചെയ്‌തിരിക്കുന്ന മറ്റൊരു EXP ബ്രെയിൻ link.send(“string”, 1, 2.55)ഉപയോഗിക്കുന്നുവെങ്കിൽ, link.receive() ഉപയോഗിക്കുന്നത് .string_1_2.5500പോലുള്ള ഒരു എൻകോഡ് ചെയ്‌ത സ്ട്രിംഗ് തിരികെ നൽകുന്നു. സന്ദേശ നാമം, പൂർണ്ണസംഖ്യ, ഫ്ലോട്ട് മൂല്യങ്ങൾ എന്നിവ എക്‌സ്‌ട്രാക്‌റ്റ് ചെയ്യുന്നതിന് നിങ്ങൾക്ക് ഈ എൻകോഡ് ചെയ്‌ത സ്ട്രിംഗ് വിഭജിക്കാം (ചുവടെയുള്ള ഉദാഹരണങ്ങൾ കാണുക).

മാനുവൽ സ്പ്ലിറ്റിംഗ്/പാഴ്‌സിംഗ് ഒഴിവാക്കാൻ നിങ്ങൾ ആഗ്രഹിക്കുന്നുവെങ്കിൽ, ഒരു പ്രത്യേക സന്ദേശ നാമത്തിനായി ഒരു ഹാൻഡ്‌ലറെ രജിസ്റ്റർ ചെയ്യുന്നതിന് received ഉപയോഗിക്കുക; അയച്ച മൂല്യങ്ങൾ ആർഗ്യുമെന്റുകളായി ഹാൻഡ്‌ലറിന് ലഭിക്കും.

Usage:
receive(timeout)

പാരാമീറ്ററുകൾ

വിവരണം

timeout

ഓപ്ഷണൽ. ക്യൂ ശൂന്യമാണെങ്കിൽ മാത്രം receive ലഭിക്കുന്ന മില്ലിസെക്കൻഡിൽ എത്ര സമയം പുതിയ സന്ദേശത്തിനായി കാത്തിരിക്കും. ഡിഫോൾട്ട് 300,000 (300 സെക്കൻഡ്) ആണ്.

റോബോട്ട് 1 നുള്ള കോഡ്

# Tell the other robot when the screen is being pressed

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.MANAGER)

# Do not run code UNTIL the Brains are linked
while not link.is_linked():
    wait(0.1, SECONDS)

brain.screen.print("Robot 1 - Manager")

# Continuously send if the screen is being pressed
while True:
    if brain.screen.pressing():
        link.send("pressed")
    else:
        link.send("released")

    wait(50, MSEC)

റോബോട്ട് 2 നുള്ള കോഡ്

# Display if the other robot's screen is being pressed

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.WORKER)

# Do not run code UNTIL the Brains are linked
while not link.is_linked():
    wait(0.1, SECONDS)

# Continuously check if Robot 1 has sent "pressed"
while True:
    brain.screen.clear_screen()
    brain.screen.set_cursor(1, 1)
    brain.screen.print("Robot 2 - Worker")
    brain.screen.next_row()

    if link.receive() == "pressed":
        brain.screen.new_line()
        brain.screen.print("Manager is being pressed!")

    wait(50, MSEC)

റോബോട്ട് 1 നുള്ള കോഡ്

# Send a math problem for the other Brain to solve

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.MANAGER)

# Do not run code UNTIL the Brains are linked
while not link.is_linked():
    wait(0.1, SECONDS)

brain.screen.print("Robot 1 - Manager")

"""
Change whether to "add" or "subtract",
then what numbers to use in the operation.
"""
link.send("add", 7, 2.5)

റോബോട്ട് 2 നുള്ള കോഡ്

# Solve the math problem that the other Brain sends

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.WORKER)

# Do not run code UNTIL the Brains are linked
while not link.is_linked():
    wait(0.1, SECONDS)

brain.screen.print("Robot 2 - Worker")
brain.screen.next_row()

math_problem = link.receive()

if math_problem:

    # Split the encoded string by _
    parts = math_problem.split("_")

    if len(parts) == 3:
        # Remove the . from the beginning of the string
        operator = "".join([c for c in parts[0] if c.isalpha()])

        # Separate out the numbers for the operation
        a = int(parts[1])
        b = float(parts[2])

        # Use what operator was sent
        if operator == "add":
            result = a + b
        elif operator == "subtract":
            result = a - b
        # If neither add or subtract is sent, do nothing
        else:
            pass

brain.screen.print("Result = ", result)

received#

received EXP ബ്രെയിൻ അയച്ച സന്ദേശം സ്വീകരിക്കുമ്പോഴെല്ലാം വിളിക്കേണ്ട ഒരു ഫംഗ്‌ഷൻ രജിസ്റ്റർ ചെയ്യുന്നു.

Usage:
link.received(message, arg)

പാരാമീറ്ററുകൾ

വിവരണം

message

പൊരുത്തപ്പെടേണ്ട സന്ദേശ നാമം (സ്ട്രിംഗ്). ലഭിച്ച സന്ദേശത്തിന്റെ പേര് ഈ മൂല്യവുമായി പൊരുത്തപ്പെടുമ്പോൾ, callback ഫംഗ്ഷൻ വിളിക്കപ്പെടുന്നു.

callback

A previously defined function that runs when the EXP Brain receives a message matching message.

received കോൾബാക്കുകൾ വിളിക്കുന്നു:

കോൾബാക്ക് ഒപ്പ്:
callback(message, linkname, index, value)

വാദം

വിവരണം

message

ലഭിച്ച സന്ദേശത്തിന്റെ പേര് (ഉദാഹരണത്തിന്, “add”).

linkname

സന്ദേശം ലഭിച്ച ലിങ്ക് നാമം.

index

സന്ദേശത്തോടൊപ്പം അയച്ച പൂർണ്ണസംഖ്യ മൂല്യം (നൽകിയിട്ടുണ്ടെങ്കിൽ).

value

സന്ദേശത്തോടൊപ്പം അയച്ച ഫ്ലോട്ട് മൂല്യം (നൽകിയിട്ടുണ്ടെങ്കിൽ).

റോബോട്ട് 1 നുള്ള കോഡ്

# Send a math problem for the other Brain to solve

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.MANAGER)

# Do not run code UNTIL the Brains are linked
while not link.is_linked():
    wait(0.1, SECONDS)

brain.screen.print("Robot 1 - Manager")

"""
Change whether to "add" or "subtract",
then what numbers to use in the operation.
"""
link.send("add", 7, 2.5)

റോബോട്ട് 2 നുള്ള കോഡ്

# Solve the math problem that the other Brain sends

# Create the link
link = MessageLink(Ports.PORT1, "VEXRoboticsLink123456789", VexlinkType.WORKER)

while not link.is_linked():
    wait(0.1, SECONDS)

brain.screen.print("Robot 2 - Worker")
brain.screen.next_row()

# add if "add" is received
def add_cmd(message, linkname, a, b):
    result = a + b
    brain.screen.print("Result = ", result)

# subtract if ""subtract" is received
def subtract_cmd(message, linkname, a, b):
    result = a - b
    brain.screen.print("Result = ", result)

# Create event handlers for "add" and "subtract"
link.received("add", add_cmd)
link.received("subtract", subtract_cmd)

previous

VEXലിങ്ക്

next

സീരിയൽ ലിങ്ക്

On this page
  • ആമുഖം
  • ഒരു ലിങ്ക് സൃഷ്ടിക്കുക
  • ലഭ്യമായ രീതികൾ
    • is_linked
    • send
    • receive
    • received
Innovation First, International
​

VEX ഉം VEX റോബോട്ടിക്സും ഇന്നൊവേഷൻ ഫസ്റ്റ്, ഇൻ‌കോർപ്പറേറ്റഡിന്റെ വ്യാപാരമുദ്രകളോ സേവന മാർക്കുകളോ ആണ്. പകർപ്പവകാശം ©2026എല്ലാ അവകാശങ്ങളും നിക്ഷിപ്തം. VEX റോബോട്ടിക്സ്, ഇൻ‌കോർപ്പറേറ്റഡ് ഇന്നൊവേഷൻ ഫസ്റ്റ് ഇന്റർനാഷണൽ, ഇൻ‌കോർപ്പറേറ്റഡിന്റെ ഒരു അനുബന്ധ സ്ഥാപനമാണ്. മറ്റുള്ളവരുടെ മറ്റെല്ലാ ഉൽപ്പന്ന നാമങ്ങളും / മാർക്കുകളും അവയുടെ ഉടമസ്ഥരുടെ സ്വത്താണ്. പേറ്റന്റുകളും / അല്ലെങ്കിൽ പേറ്റന്റുകളും തീർപ്പുകൽപ്പിച്ചിട്ടില്ല - innovationfirst.com/patents
സൈറ്റ് സ്വകാര്യതാ നയം / സൈറ്റ് ഉപയോഗ നിബന്ധനകൾ / കുക്കി നയം / സോഫ്റ്റ്‌വെയർ സ്വകാര്യതാ നയം

VEX റോബോട്ടിക്സ് ഫേസ്ബുക്ക് പേജ് സന്ദർശിക്കുക VEX റോബോട്ടിക്സ് ട്വിറ്റർ പേജ് സന്ദർശിക്കുക VEX റോബോട്ടിക്സ് ഇൻസ്റ്റാഗ്രാം പേജ് സന്ദർശിക്കുക VEX റോബോട്ടിക്സ് യൂട്യൂബ് പേജ് സന്ദർശിക്കുക
VEX API ഫീഡ്‌ബാക്ക് ഫോം

നിങ്ങളുടെ ഫീഡ്‌ബാക്കിനെ ഞങ്ങൾ വിലമതിക്കുന്നു! VEX API-യിൽ നിർദ്ദേശങ്ങൾ, അഭിനന്ദനങ്ങൾ അല്ലെങ്കിൽ പിശകുകൾ റിപ്പോർട്ട് ചെയ്യാൻ ഈ ഫോം ഉപയോഗിക്കുക. VEX API ഡോക്യുമെന്റേഷൻ മെച്ചപ്പെടുത്താൻ നിങ്ങളുടെ അഭിപ്രായം ഞങ്ങളെ സഹായിക്കുന്നു.

​

നിങ്ങൾക്ക് സാങ്കേതിക പ്രശ്നങ്ങൾ നേരിടുന്നുണ്ടെങ്കിലോ ഉപഭോക്തൃ പിന്തുണ ആവശ്യമുണ്ടെങ്കിലോ, ദയവായി support.vex.comസന്ദർശിക്കുക.

  • Send Happy Feedback
  • Send Sad Feedback

കുറിപ്പ്: നിലവിലെ URL നിങ്ങളുടെ സന്ദേശവുമായി പങ്കിടും.

നിങ്ങളുടെ ഇമെയിൽ വിലാസം ഉൾപ്പെടുത്തുന്നതിലൂടെ, നിങ്ങളുടെ ഫീഡ്‌ബാക്കിനെക്കുറിച്ച് ഞങ്ങൾക്ക് എന്തെങ്കിലും ചോദ്യങ്ങളുണ്ടെങ്കിൽ VEX നിങ്ങൾക്ക് ഇമെയിൽ ഇമെയിലുകൾ അയച്ചേക്കാമെന്ന് നിങ്ങൾ സമ്മതിക്കുന്നു.
സ്വകാര്യതാ നയം >
ദയവായി നിങ്ങളുടെ ഫീഡ്‌ബാക്ക് നൽകുക. ഫീഡ്‌ബാക്ക് വിജയകരമായി സമർപ്പിച്ചു!
Choose Which VEX IQ Generation to View

VEX IQ (1st gen)

VEX IQ (2nd gen)